-
Notifications
You must be signed in to change notification settings - Fork 1
44 lines (43 loc) · 1.33 KB
/
docker-build-push.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: build and push docker image
run-name: build and push docker image
on:
release:
types: [published]
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: prepare tags
id: prep
run: |
IMAGE="dnastack/wdl-ci"
VERSION_TAG=`git describe --tags --abbrev=0`
LONG_VERSION_TAG=`git describe --tags --long --always`
LATEST_TAG="latest"
ALL_TAGS="${IMAGE}:${VERSION_TAG},${IMAGE}:${LONG_VERSION_TAG},${IMAGE}:${LATEST_TAG}"
echo ::set-output name=all_tags::${ALL_TAGS}
- name: set up QEMU
uses: docker/setup-qemu-action@master
with:
platforms: all
- name: set up docker buildx
id: buildx
uses: docker/setup-buildx-action@master
- name: login to dockerhub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: build
uses: docker/build-push-action@v2
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm/v7,linux/arm64/v8
push: true
tags: ${{ steps.prep.outputs.all_tags }}