From d4b0793746687551b098365cb725a46fc836d7f9 Mon Sep 17 00:00:00 2001 From: KingPin Date: Fri, 12 Apr 2024 15:23:25 -0400 Subject: [PATCH] add ghcr.io push to canary docker builds --- .github/workflows/docker-publish-canary.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish-canary.yml b/.github/workflows/docker-publish-canary.yml index 4cd378a..e485f0e 100644 --- a/.github/workflows/docker-publish-canary.yml +++ b/.github/workflows/docker-publish-canary.yml @@ -6,6 +6,9 @@ on: jobs: docker: runs-on: ubuntu-latest + permissions: + contents: write + packages: write steps: - name: Checkout @@ -19,7 +22,9 @@ jobs: id: meta uses: docker/metadata-action@v5 with: - images: moonrailgun/tianji + images: | + moonrailgun/tianji + ghcr.io/moonrailgun/tianji tags: | type=sha - name: Login to DockerHub @@ -28,6 +33,13 @@ jobs: with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Log into ghcr.io registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Build and push