docker: push images to GHCR too

use numeric id for user inside Dockerfile
This commit is contained in:
Nicola Murino
2020-10-18 19:18:51 +02:00
parent 1625cd5a9f
commit d812c86812
4 changed files with 19 additions and 6 deletions

View File

@@ -18,7 +18,12 @@ jobs:
matrix:
os:
- ubuntu-latest
docker_pkg: [debian, alpine]
docker_pkg:
- debian
- alpine
docker_image:
- drakkan/sftpgo
- ghcr.io/drakkan/sftpgo
steps:
- name: Checkout
uses: actions/checkout@v2
@@ -34,7 +39,6 @@ jobs:
- name: Gather image information
id: info
run: |
DOCKER_IMAGE=drakkan/sftpgo
VERSION=noop
DOCKERFILE=Dockerfile
MINOR=""
@@ -80,6 +84,7 @@ jobs:
echo ::set-output name=sha::${GITHUB_SHA::8}
env:
DOCKER_PKG: ${{ matrix.docker_pkg }}
DOCKER_IMAGE: ${{ matrix.docker_image }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
@@ -92,7 +97,15 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
if: github.event_name != 'pull_request'
if: ${{ github.event_name != 'pull_request' && matrix.docker_image == 'drakkan/sftpgo' }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}
if: ${{ github.event_name != 'pull_request' && matrix.docker_image == 'ghcr.io/drakkan/sftpgo' }}
- name: Build and push
uses: docker/build-push-action@v2