Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 25 additions & 2 deletions .github/workflows/docker_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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

Expand All @@ -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
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/ghcr-cleanup.yml
Original file line number Diff line number Diff line change
@@ -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