-
Notifications
You must be signed in to change notification settings - Fork 376
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1290 from GIScience/fix-github-release-workflow
Isolate workflows for nightly and version docker images
- Loading branch information
Showing
2 changed files
with
62 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: Build and publish the nightly Docker image | ||
on: | ||
pull_request: | ||
branches: [ master ] | ||
push: | ||
branches: [ master ] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build_and_publish_docker: | ||
name: Build and push the image to docker hub | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2.2.0 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
id: buildx | ||
with: | ||
install: true | ||
- name: Prepare | ||
id: prepare | ||
run: | | ||
DOCKER_IMAGE=openrouteservice/openrouteservice | ||
DOCKER_PLATFORMS=linux/amd64 | ||
TAGS_NIGHTLY="${DOCKER_IMAGE}:nightly" | ||
echo ::set-output name=build_args::--platform ${DOCKER_PLATFORMS} | ||
echo ::set-output name=buildx_tags_nightly::${TAGS_NIGHTLY} | ||
- name: Build nightly | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
push: false | ||
tags: ${{ steps.prepare.outputs.buildx_tags_nightly }} | ||
build-args: ${{ steps.prepare.outputs.build_args }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
- name: Login to DockerHub | ||
if: ${{ success() && github.ref == 'refs/heads/master' }} | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_TOKEN }} | ||
- name: Publish nightly | ||
if: ${{ github.ref == 'refs/heads/master' }} | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ steps.prepare.outputs.buildx_tags_nightly }} | ||
build-args: ${{ steps.prepare.outputs.build_args }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters