From ef1264921e91c936e5a0122e331ffab9552a1e0b Mon Sep 17 00:00:00 2001 From: nolhan Date: Sat, 18 Apr 2026 16:05:23 +0200 Subject: [PATCH 1/2] chore(ci): added version tag and auto-deploy to docker build ci --- .github/workflows/docker_build.yml | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker_build.yml b/.github/workflows/docker_build.yml index 4a29fd98..3d022b69 100644 --- a/.github/workflows/docker_build.yml +++ b/.github/workflows/docker_build.yml @@ -112,6 +112,18 @@ jobs: pull-requests: write steps: + - name: Checkout repository + uses: actions/checkout@v6 + with: + fetch-depth: 0 + + - name: Get version tag + id: version + if: github.event_name == 'workflow_run' + run: | + VERSION=$(git describe --tags --abbrev=0 2>/dev/null || echo "") + echo "tag=${VERSION}" >> $GITHUB_OUTPUT + - name: Download digests uses: actions/download-artifact@v4 with: @@ -137,8 +149,8 @@ jobs: TAGS="$TAGS -t ${{ env.GHCR_REPO }}:latest${{ matrix.suffix }}" fi - if [[ "${{ github.event_name }}" == "release" ]]; then - VERSION="${{ github.event.release.tag_name }}" + if [[ -n "${{ steps.version.outputs.tag }}" ]]; then + VERSION="${{ steps.version.outputs.tag }}" TAGS="$TAGS -t ${{ env.GHCR_REPO }}:${VERSION}${{ matrix.suffix }}" fi @@ -149,6 +161,17 @@ jobs: docker buildx imagetools create $TAGS \ $(printf '${{ env.GHCR_REPO }}@sha256:%s ' *) + deploy: + runs-on: ubuntu-latest + needs: merge + if: > + (github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success') && + github.ref_name == 'master' + steps: + - name: Trigger cloud deployment + run: | + curl --fail -X GET "${{ secrets.COOLIFY_WEBHOOK_URL }}" --header 'Authorization: Bearer ${{ secrets.COOLIFY_WEBHOOK_SECRET }}' + notify: runs-on: ubuntu-latest needs: merge From d7d6e40d6574b782e86e45e884a65af6f0136887 Mon Sep 17 00:00:00 2001 From: nolhan Date: Sat, 18 Apr 2026 16:06:35 +0200 Subject: [PATCH 2/2] chore(ci): added ghcr-cleanup workflow --- .github/workflows/ghcr-cleanup.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/ghcr-cleanup.yml diff --git a/.github/workflows/ghcr-cleanup.yml b/.github/workflows/ghcr-cleanup.yml new file mode 100644 index 00000000..38ec25c3 --- /dev/null +++ b/.github/workflows/ghcr-cleanup.yml @@ -0,0 +1,21 @@ +name: Clean Untagged Images + +on: + schedule: + - cron: '0 3 * * 0' + workflow_dispatch: + +jobs: + cleanup: + runs-on: ubuntu-latest + permissions: + packages: write + + steps: + - name: Delete untagged image versions + uses: actions/delete-package-versions@v5 + with: + package-name: api + package-type: container + delete-only-untagged-versions: true + min-versions-to-keep: 0