Skip to content
Snippets Groups Projects
Commit a37a2dd0 authored by Frédéric Guillot's avatar Frédéric Guillot
Browse files

Publish Docker images to GitHub Container Registry

parent 519fbcf5
No related branches found
No related tags found
No related merge requests found
...@@ -6,7 +6,7 @@ on: ...@@ -6,7 +6,7 @@ on:
tags: tags:
- '*.*.*' - '*.*.*'
jobs: jobs:
multi: docker-images:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
...@@ -21,13 +21,12 @@ jobs: ...@@ -21,13 +21,12 @@ jobs:
DOCKER_VERSION=dev DOCKER_VERSION=dev
if [ "${{ github.event_name }}" = "schedule" ]; then if [ "${{ github.event_name }}" = "schedule" ]; then
DOCKER_VERSION=nightly DOCKER_VERSION=nightly
TAGS="${DOCKER_IMAGE}:${DOCKER_VERSION},ghcr.io/${DOCKER_IMAGE}:${DOCKER_VERSION}"
elif [[ $GITHUB_REF == refs/tags/* ]]; then elif [[ $GITHUB_REF == refs/tags/* ]]; then
DOCKER_VERSION=${GITHUB_REF#refs/tags/} 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 fi
TAGS="${DOCKER_IMAGE}:${DOCKER_VERSION}"
echo ::set-output name=version::${DOCKER_VERSION}
echo ::set-output name=tags::${TAGS} echo ::set-output name=tags::${TAGS}
echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ')
- name: Set up QEMU - name: Set up QEMU
uses: docker/setup-qemu-action@v1 uses: docker/setup-qemu-action@v1
...@@ -41,6 +40,13 @@ jobs: ...@@ -41,6 +40,13 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }} username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }} 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 - name: Build and push
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
with: with:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment