add ghcr.io push to canary docker builds

This commit is contained in:
KingPin 2024-04-12 15:23:25 -04:00 committed by moonrailgun
parent 2fe78d8b0f
commit d4b0793746

View File

@ -6,6 +6,9 @@ on:
jobs: jobs:
docker: docker:
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps: steps:
- name: Checkout - name: Checkout
@ -19,7 +22,9 @@ jobs:
id: meta id: meta
uses: docker/metadata-action@v5 uses: docker/metadata-action@v5
with: with:
images: moonrailgun/tianji images: |
moonrailgun/tianji
ghcr.io/moonrailgun/tianji
tags: | tags: |
type=sha type=sha
- name: Login to DockerHub - name: Login to DockerHub
@ -28,6 +33,13 @@ jobs:
with: with:
username: ${{ secrets.DOCKERHUB_USERNAME }} username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }} 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 - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3 uses: docker/setup-buildx-action@v3
- name: Build and push - name: Build and push