-
Notifications
You must be signed in to change notification settings - Fork 2
54 lines (51 loc) · 1.84 KB
/
build_image.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
45
46
47
48
49
50
51
52
53
54
name: Build Docker image
on:
release:
types: [ published ]
workflow_dispatch:
inputs:
tag:
description: image tag
required: true
jobs:
build:
runs-on: ubuntu-latest
steps:
# Setup (see https://github.com/docker/build-push-action)
- name: Checkout
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@6520a2d2cb6db42c90c297c8025839c98e531268
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@044aaa9258972fc1ab44730789e42d66b720789c
- name: Login to DockerHub
uses: docker/login-action@adb73476b6e06caddec5db0bc1deacbec8cdd947
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# Publish to Docker hub
- name: Store version number (on release)
if: ${{ github.event_name == 'release' }}
id: version
run: echo ::set-output name=number::${GITHUB_REF##*/v}
- name: Build and push (on release)
if: ${{ github.event_name == 'release' }}
uses: docker/build-push-action@6efc2b01cbb63cfc68c370c6c806586fa6384a3a
with:
push: true
context: .
file: Dockerfile
# GITHUB_REF looks like "refs/tags/v0.3.1" - we need to extract the actual version without the v prefix
tags: |
blsq/geohealthaccess:${{ steps.version.outputs.number }}
blsq/geohealthaccess:latest
- name: Build and push (manual)
if: ${{ github.event_name == 'workflow_dispatch' }}
uses: docker/build-push-action@6efc2b01cbb63cfc68c370c6c806586fa6384a3a
with:
push: true
context: .
file: Dockerfile
tags: |
blsq/geohealthaccess:${{ github.event.inputs.tag }}
blsq/geohealthaccess:latest