From 29b81e6babd5103d6344f5c3491e699d1e6de03b Mon Sep 17 00:00:00 2001 From: fxyoge Date: Sat, 7 Feb 2026 16:07:16 -0600 Subject: [PATCH] Push container to GHCR --- .github/workflows/ci.yml | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d0cabf3..d92c3cb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,11 +34,35 @@ jobs: docker-build: runs-on: ubuntu-latest needs: python-checks + permissions: + contents: read + packages: write steps: - name: Check out repository uses: actions/checkout@v4 - - name: Build Docker image - run: docker build . --tag github-notifications-rss:test + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + if: ${{ github.event_name != 'pull_request' }} + + - name: Extract metadata for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: ghcr.io/${{ github.repository }} + tags: | + type=sha + type=raw,value=latest,enable={{is_default_branch}} + - name: Build and push Docker image + uses: docker/build-push-action@v6 + with: + context: . + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}