generated from populationgenomics/cpg-python-template-repo
-
Notifications
You must be signed in to change notification settings - Fork 4
47 lines (41 loc) · 1.1 KB
/
docker.yaml
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
name: Docker
on:
pull_request:
push:
branches:
- main
env:
VERSION: 1.1.4
jobs:
docker:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
env:
DOCKER_BUILDKIT: 1
BUILDKIT_PROGRESS: plain
CLOUDSDK_CORE_DISABLE_PROMPTS: 1
BASE_IMAGE: australia-southeast1-docker.pkg.dev/cpg-common/images/cpg_aip
steps:
- uses: actions/checkout@main
- name: gcloud auth
uses: 'google-github-actions/auth@v0'
with:
credentials_json: ${{ secrets.GH_IMAGES_DEPLOYER_JSON }}
- name: set up gcloud sdk
uses: google-github-actions/setup-gcloud@v0
with:
project_id: cpg-common
- name: gcloud docker auth
run: |
gcloud auth configure-docker australia-southeast1-docker.pkg.dev
- name: build
run: |
docker build . -f Dockerfile --tag $BASE_IMAGE:$VERSION
- name: push latest
if: ${{ github.event_name != 'pull_request' }}
run: |
docker tag $BASE_IMAGE:$VERSION $BASE_IMAGE:latest
docker push $BASE_IMAGE:$VERSION
docker push $BASE_IMAGE:latest