From 73a2b91251cf4e0f164b94ced05aab74ec2b9227 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torben=20H=C3=B8rup?= Date: Thu, 30 Sep 2021 20:45:15 +0200 Subject: [PATCH] Add GH actions script for docker image (#6138) * Add GH actions script for docker image * Updated Changelog --- .github/workflows/osrm-backend-docker.yml | 85 +++++++++++++++++++++++ CHANGELOG.md | 3 + 2 files changed, 88 insertions(+) create mode 100644 .github/workflows/osrm-backend-docker.yml diff --git a/.github/workflows/osrm-backend-docker.yml b/.github/workflows/osrm-backend-docker.yml new file mode 100644 index 000000000..2ca918607 --- /dev/null +++ b/.github/workflows/osrm-backend-docker.yml @@ -0,0 +1,85 @@ +name: build and publish container image +on: + push: + tags: + - 'v*' + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v2 + + + - name: Docker meta + id: meta + uses: docker/metadata-action@v3 + with: + images: ghcr.io/${{ github.repository }} + + - name: Docker meta - debug + id: metadebug + uses: docker/metadata-action@v3 + with: + images: ghcr.io/${{ github.repository }} + flavor: | + latest=true + suffix=-debug,onlatest=true + + - name: Docker meta - assertions + id: metaassertions + uses: docker/metadata-action@v3 + with: + images: ghcr.io/${{ github.repository }} + flavor: | + latest=true + suffix=-assertions,onlatest=true + + + + + - name: Log in to GitHub Docker Registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + + + + + + + - name: Build container image - debug + uses: docker/build-push-action@v2 + with: + push: true + file: ./docker/Dockerfile + tags: ${{ steps.metadebug.outputs.tags }} + build-args: | + DOCKER_TAG=${{ join(steps.metadebug.outputs.tags ) }} + + + - name: Build container image - assertions + uses: docker/build-push-action@v2 + with: + push: true + file: ./docker/Dockerfile + tags: ${{ steps.metaassertions.outputs.tags }} + build-args: | + DOCKER_TAG=${{ join(steps.metaassertions.outputs.tags ) }} + + # build and publish "normal" image as last to get it listed on top + - name: Build container image - normal + uses: docker/build-push-action@v2 + with: + push: true + file: ./docker/Dockerfile + tags: ${{ steps.meta.outputs.tags }} + build-args: | + DOCKER_TAG=${{ join(steps.meta.outputs.tags ) }} + + + diff --git a/CHANGELOG.md b/CHANGELOG.md index 9bf570239..cca1ffdef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,7 @@ # Unreleased + - Changes from 5.26.0 + - Build: + - CHANGED: Use Github Actions for building container images [#6138](https://github.com/Project-OSRM/osrm-backend/pull/6138) # 5.26.0 - Changes from 5.25.0