From 07af2e0329ca79ca55a0900d01f346d3c8d12b0d Mon Sep 17 00:00:00 2001 From: brooke Date: Tue, 4 Mar 2025 00:40:35 -0500 Subject: [PATCH] initial --- .forgejo/workflows/build.yml | 53 ++++++++++++++++++++++++++++++++++++ .gitmodules | 3 ++ liberaforms | 1 + 3 files changed, 57 insertions(+) create mode 100644 .forgejo/workflows/build.yml create mode 100644 .gitmodules create mode 160000 liberaforms diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml new file mode 100644 index 0000000..ea106d3 --- /dev/null +++ b/.forgejo/workflows/build.yml @@ -0,0 +1,53 @@ +name: Build And Publish Docker + +on: + workflow_dispatch + +jobs: + build-auto: + container: + image: docker:dind + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Install deps + run: curl -fsSL https://get.docker.com -o get-docker.sh && sh get-docker.sh + + - 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: | + # Fetch the tags from the GitLab API + 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 }}" + # Filter tags to exclude those that end with 'RC[0-9]' + 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 + file: ./Dockerfile + platforms: linux/amd64 + push: true + tags: fung.uy/mycosystems/liberaforms:${{ steps.filter_tags.outputs.latest_tag }} diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..341c974 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "liberaforms"] + path = liberaforms + url = https://gitlab.com/liberaforms/liberaforms.git diff --git a/liberaforms b/liberaforms new file mode 160000 index 0000000..186fd6b --- /dev/null +++ b/liberaforms @@ -0,0 +1 @@ +Subproject commit 186fd6bd87e54f2dbe6cb437cd4c1361decd2bfa