diff options
Diffstat (limited to '.github/workflows/publish.yml')
| -rw-r--r-- | .github/workflows/publish.yml | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 744bb1488..1ef46b631 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -27,20 +27,25 @@ jobs: test-php: uses: ./.github/workflows/php-code-quality.yml - publish-dockerhub: - name: Publish ${{ matrix.image.name }} to Docker Hub + publish: + name: Publish Docker image ${{ matrix.image.name }} needs: - test-php runs-on: ubuntu-latest + permissions: + contents: read + packages: write strategy: matrix: image: - name: app dockerfile: ./.docker/app/Dockerfile - repository: supahgreg/tt-rss + repository_dockerhub: supahgreg/tt-rss + repository_ghcr: ghcr.io/tt-rss/tt-rss - name: web-nginx dockerfile: ./.docker/web-nginx/Dockerfile - repository: supahgreg/tt-rss-web-nginx + repository_dockerhub: supahgreg/tt-rss-web-nginx + repository_ghcr: ghcr.io/tt-rss/tt-rss-web-nginx steps: - name: Check out code @@ -52,6 +57,13 @@ jobs: - name: Get commit short SHA run: echo "COMMIT_SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Log in to Docker Hub uses: docker/login-action@v3 with: @@ -62,7 +74,9 @@ jobs: id: meta uses: docker/metadata-action@v5 with: - images: ${{ matrix.image.repository }} + images: | + ${{ matrix.image.repository_dockerhub }} + ${{ matrix.image.repository_ghcr }} tags: | # update 'latest' type=raw,value=latest @@ -75,7 +89,7 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Build and push to Docker Hub + - name: Build and push to image registries id: push uses: docker/build-push-action@v6 with: |