From ab7b03ac59d817f5a3d11a0b85701dc84aa85809 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Wed, 5 Apr 2023 14:01:05 +0200 Subject: [PATCH] Add GHCR.io as publishing target (#4561) * update deps * Add GHCR.io as publishing target Fixes #4560 * add permissions * Revert "update deps" This reverts commit cb2f612bb35437dc5023268f640c107de67aa82c. --- .github/workflows/docker.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index 199bf4d939..15e29d0612 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -34,6 +34,8 @@ jobs: cancel-in-progress: true runs-on: ubuntu-latest permissions: + contents: read + packages: write id-token: write env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -95,6 +97,15 @@ jobs: with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Log into registry ghcr.io + if: github.event_name != 'pull_request' + uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # pin@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Extract Docker metadata if: github.event_name != 'pull_request' id: meta @@ -102,6 +113,8 @@ jobs: with: images: | inventree/inventree + ghcr.io/inventree/inventree + - name: Build and Push id: build-and-push if: github.event_name != 'pull_request' @@ -115,6 +128,7 @@ jobs: build-args: | commit_hash=${{ env.git_commit_hash }} commit_date=${{ env.git_commit_date }} + - name: Sign the published image if: ${{ false }} # github.event_name != 'pull_request' env: