Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GH actions script for docker image #6137

Closed
wants to merge 15 commits into from
84 changes: 84 additions & 0 deletions .github/workflows/osrm-backend-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: build and publish container image
on:
push:
tags:
- 'v*'
branches:
- master

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 }}/osrm-backend

- name: Docker meta - debug
id: metadebug
uses: docker/metadata-action@v3
with:
images: ghcr.io/${{ github.repository }}/osrm-backend
flavor: |
latest=true
suffix=-debug,onlatest=true

- name: Docker meta - assertions
id: metaassertions
uses: docker/metadata-action@v3
with:
images: ghcr.io/${{ github.repository }}/osrm-backend
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 - normal
uses: docker/build-push-action@v2
with:
push: true
file: ./docker/Dockerfile
tags: ${{ steps.meta.outputs.labels }}
build-args:
- DOCKER_TAG: ${{ steps.meta.outputs.labels }}


- name: Build container image - debug
uses: docker/build-push-action@v2
with:
push: true
file: ./docker/Dockerfile
tags: ${{ steps.metadebug.outputs.labels }}
build-args:
- DOCKER_TAG: ${{ steps.metadebug.outputs.labels }}


- name: Build container image - assertions
uses: docker/build-push-action@v2
with:
push: true
file: ./docker/Dockerfile
tags: ${{ steps.metaassertions.outputs.labels }}
build-args:
- DOCKER_TAG: ${{ steps.metaassertions.outputs.labels }}