Skip to content

Commit

Permalink
Push Docker images to GitHub container registry
Browse files Browse the repository at this point in the history
  • Loading branch information
fguillot committed Oct 28, 2020
1 parent 7abb6d6 commit 79ccb7a
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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:
Expand Down

0 comments on commit 79ccb7a

Please sign in to comment.