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 - take 2 #6138

Merged
merged 3 commits into from
Sep 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 85 additions & 0 deletions .github/workflows/osrm-backend-docker.yml
Original file line number Diff line number Diff line change
@@ -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 ) }}



3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down