2025-03-04 00:40:35 -05:00
|
|
|
name: Build And Publish Docker
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch
|
|
|
|
|
|
|
|
jobs:
|
2025-03-04 02:42:02 -05:00
|
|
|
build:
|
2025-03-04 00:40:35 -05:00
|
|
|
container:
|
2025-03-04 00:44:59 -05:00
|
|
|
image: node:lts-bookworm
|
2025-03-04 00:40:35 -05:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
with:
|
2025-03-04 00:53:28 -05:00
|
|
|
submodules: 'true'
|
|
|
|
|
2025-03-04 00:40:35 -05:00
|
|
|
- name: Install deps
|
2025-03-04 00:47:57 -05:00
|
|
|
run: curl -fsSL https://get.docker.com -o get-docker.sh && sh get-docker.sh && apt update && apt install -y jq
|
2025-03-04 00:40:35 -05:00
|
|
|
|
|
|
|
- name: Set up Docker Buildx
|
|
|
|
id: buildx
|
|
|
|
uses: docker/setup-buildx-action@master
|
|
|
|
|
|
|
|
- name: Login to Self-Hosted Registry
|
|
|
|
uses: docker/login-action@v3
|
|
|
|
with:
|
|
|
|
registry: fung.uy
|
|
|
|
username: ${{ secrets.MYCO_REGISTRY_USER }}
|
|
|
|
password: ${{ secrets.MYCO_PERSONAL_ACCESS_TOKEN }}
|
|
|
|
|
|
|
|
- name: Get tags from GitLab repository
|
|
|
|
id: get_tags
|
|
|
|
run: |
|
|
|
|
TAGS=$(curl --header "PRIVATE-TOKEN: ${{ secrets.GITLAB_ACCESS_TOKEN }}" "https://gitlab.com/api/v4/projects/liberaforms%2Fliberaforms/repository/tags" | jq -r '.[].name')
|
|
|
|
echo "::set-output name=tags::$TAGS"
|
|
|
|
|
|
|
|
- name: Filter out RC tags and get the latest version
|
|
|
|
id: filter_tags
|
|
|
|
run: |
|
|
|
|
TAGS="${{ steps.get_tags.outputs.tags }}"
|
|
|
|
FILTERED_TAGS=$(echo "$TAGS" | grep -Ev 'RC[0-9]$' | sort -V | tail -n 1)
|
|
|
|
echo "Latest tag excluding RC: $FILTERED_TAGS"
|
|
|
|
echo "::set-output name=latest_tag::$FILTERED_TAGS"
|
|
|
|
|
|
|
|
- name: Build and Push with Latest Tag
|
|
|
|
uses: docker/build-push-action@v4
|
|
|
|
with:
|
|
|
|
builder: ${{ steps.buildx.outputs.name }}
|
|
|
|
context: ./liberaforms
|
2025-03-04 00:49:38 -05:00
|
|
|
file: ./liberaforms/Dockerfile
|
2025-03-04 00:40:35 -05:00
|
|
|
platforms: linux/amd64
|
|
|
|
push: true
|
|
|
|
tags: fung.uy/mycosystems/liberaforms:${{ steps.filter_tags.outputs.latest_tag }}
|