-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Docker images for arm, arm64, ppc64le and s390x
- Loading branch information
Showing
4 changed files
with
79 additions
and
22 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
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
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,75 @@ | ||
name: Docker | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
tags: | ||
- 'v[0-9]+.[0-9]+.[0-9]+' | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
env: | ||
PLATFORMS: "linux/arm,linux/amd64,linux/arm64,linux/ppc64le,linux/s390x" | ||
|
||
jobs: | ||
build-docker: | ||
name: Build Docker Image | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Cache Docker layers | ||
uses: actions/cache@v2 | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-buildx-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-buildx- | ||
- name: Output Variables | ||
id: var | ||
run: | | ||
echo "::set-output name=nginx_version::$(grep -m1 'FROM nginx:' <Dockerfile | awk -F'[: ]' '{print $3}')" | ||
- name: Setup QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
with: | ||
platforms: arm64,ppc64le | ||
if: github.event_name != 'pull_request' | ||
|
||
- name: Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: DockerHub Login | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
if: github.event_name != 'pull_request' | ||
|
||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v3 | ||
with: | ||
images: opentracing/nginx-opentracing | ||
tags: | | ||
type=edge | ||
type=ref,event=pr | ||
type=semver,pattern={{version}} | ||
type=raw,value=nginx-${{ steps.var.outputs.nginx_version }},enable=${{ contains(github.ref, 'refs/tags/') }} | ||
- name: Build (and push if not PR) | ||
uses: docker/build-push-action@v2 | ||
with: | ||
pull: true | ||
load: ${{ github.event_name == 'pull_request' }} | ||
push: ${{ github.event_name != 'pull_request' }} | ||
platforms: ${{ github.event_name != 'pull_request' && env.PLATFORMS || '' }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache,mode=max | ||
target: final |
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