From 2fe78d8b0f52b1c59f9ab32dfe24f5f32efcc226 Mon Sep 17 00:00:00 2001 From: KingPin Date: Tue, 9 Apr 2024 18:54:03 -0400 Subject: [PATCH] add ghcr.io docker image registery Added permission to allow writing to the ghcr.io registry used existing PAT to login to ghcr.io add ghcr.io to image list. --- .github/workflows/docker-publish.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 82137ae..5b7b1a4 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -9,6 +9,9 @@ on: jobs: docker: runs-on: ubuntu-latest + permissions: + contents: write + packages: write steps: - name: Checkout @@ -22,7 +25,9 @@ jobs: id: meta uses: docker/metadata-action@v5 with: - images: moonrailgun/tianji + images: | + moonrailgun/tianji + ghcr.io/moonrailgun/tianji tags: | type=semver,pattern={{version}} - name: Login to DockerHub @@ -31,6 +36,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