From a37a2dd04373ad71f5ce096a89c4f7ec9849f397 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Guillot?= Date: Wed, 28 Oct 2020 21:18:07 -0700 Subject: [PATCH] Publish Docker images to GitHub Container Registry --- .github/workflows/docker.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 0796852f..2a7aa5ca 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -6,7 +6,7 @@ on: tags: - '*.*.*' jobs: - multi: + docker-images: runs-on: ubuntu-latest steps: - name: Checkout @@ -21,13 +21,12 @@ jobs: DOCKER_VERSION=dev if [ "${{ github.event_name }}" = "schedule" ]; then DOCKER_VERSION=nightly + TAGS="${DOCKER_IMAGE}:${DOCKER_VERSION},ghcr.io/${DOCKER_IMAGE}:${DOCKER_VERSION}" elif [[ $GITHUB_REF == refs/tags/* ]]; then DOCKER_VERSION=${GITHUB_REF#refs/tags/} + TAGS="${DOCKER_IMAGE}:${DOCKER_VERSION},ghcr.io/${DOCKER_IMAGE}:${DOCKER_VERSION},${DOCKER_IMAGE}:latest,ghcr.io/${DOCKER_IMAGE}:latest" fi - TAGS="${DOCKER_IMAGE}:${DOCKER_VERSION}" - echo ::set-output name=version::${DOCKER_VERSION} echo ::set-output name=tags::${TAGS} - echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ') - name: Set up QEMU uses: docker/setup-qemu-action@v1 @@ -41,6 +40,13 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Login to GitHub Container Registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.CR_PAT }} + - name: Build and push uses: docker/build-push-action@v2 with: