From 79ccb7a2b0313e6bc755f1860ac42a1037573f69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Guillot?= Date: Tue, 27 Oct 2020 20:01:00 -0700 Subject: [PATCH] Push Docker images to GitHub container registry --- .github/workflows/docker.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index b912ef6d4..54f60af6a 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -16,16 +16,17 @@ jobs: id: docker_tag run: | SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8` + APP_VERSION="master.${SHORT_SHA}" DOCKER_IMAGE=kanboard/kanboard DOCKER_VERSION=dev - APP_VERSION="master.${SHORT_SHA}" 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/} APP_VERSION=$DOCKER_VERSION + 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::${APP_VERSION} echo ::set-output name=tags::${TAGS} echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ') @@ -42,6 +43,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: