forked from ckan/ckan-docker
-
Notifications
You must be signed in to change notification settings - Fork 2
46 lines (39 loc) · 1.31 KB
/
build.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
name: Build - Dev and Prod Images
on:
push:
branches:
- master
- dev-sample
- dev-data
jobs:
build-and-push-ghcr:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Log in to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ vars.USERNAME }}
password: ${{ secrets.TOKEN }}
- name: Set dynamic tag
id: set-tag
run: |
if [[ "${{ github.ref }}" == "refs/heads/dev-sample" ]]; then
echo "::set-output name=tag::ghcr.io/auscope/auscope-ckan-dev:sample-latest"
elif [[ "${{ github.ref }}" == "refs/heads/dev-data" ]]; then
echo "::set-output name=tag::ghcr.io/auscope/auscope-ckan-dev:data-latest"
else
echo "::set-output name=tag::ghcr.io/auscope/auscope-ckan-dev:latest"
fi
- name: Build and Push Docker image to GHCR
uses: docker/build-push-action@v2
with:
context: ./ckan
file: ./ckan/Dockerfile # Consider using a separate Dockerfile for dev if needed
tags: ${{ steps.set-tag.outputs.tag }}
push: true