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.
This commit is contained in:
KingPin 2024-04-09 18:54:03 -04:00 committed by moonrailgun
parent 1dec411dd3
commit 2fe78d8b0f

View File

@ -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