From fc7566203692dd5b4dc9cb117e50aeeaaea69ea7 Mon Sep 17 00:00:00 2001 From: Max P Date: Mon, 23 Feb 2026 17:33:08 -0500 Subject: [PATCH] ci(deploy): publish GHCR image on main pushes --- .github/workflows/docker-image-main-ghcr.yml | 50 ++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/docker-image-main-ghcr.yml diff --git a/.github/workflows/docker-image-main-ghcr.yml b/.github/workflows/docker-image-main-ghcr.yml new file mode 100644 index 000000000..df5cebcda --- /dev/null +++ b/.github/workflows/docker-image-main-ghcr.yml @@ -0,0 +1,50 @@ +name: Docker image CD (main, GHCR) + +on: + push: + branches: + - 'main' + +permissions: + contents: read + packages: write + +jobs: + build_and_push: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Docker metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: ghcr.io/${{ github.repository_owner }}/ghostfolio + tags: | + type=raw,value=main + type=sha,prefix=sha- + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to GHCR + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v6 + with: + context: . + platforms: linux/amd64 + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max