-
Notifications
You must be signed in to change notification settings - Fork 31
73 lines (60 loc) · 1.98 KB
/
docker.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
---
name: Docker
on:
workflow_dispatch:
push:
branches:
- develop
paths:
- "**"
release:
types: [published]
env:
IMAGE_NAME: opendatacube/explorer
jobs:
docker:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/develop' || github.event_name == 'release'
steps:
- name: Checkout git
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get unstable git tag
run: >
echo "UNSTABLE_TAG=$(git describe --tags)" >> $GITHUB_ENV
- name: Log the unstable tag
run: echo $UNSTABLE_TAG
- name: Build and Push unstable + latest Docker image tag
if: github.event_name != 'release'
uses: whoan/docker-build-with-cache-action@v8
with:
image_name: ${{ env.IMAGE_NAME }}
username: gadockersvc
image_tag: ${{ env.UNSTABLE_TAG }},latest
password: "${{ secrets.DockerPassword }}"
build_extra_args: "--build-arg=ENVIRONMENT=deployment"
# This section is for releases
- name: Get tag for this build if it exists
if: github.event_name == 'release'
run: >
echo "RELEASE=$(git describe --abbrev=0 --tags)" >> $GITHUB_ENV
- name: Log the tag
run: echo $RELEASE
- name: Build and Push release if we have a tag
uses: whoan/docker-build-with-cache-action@v8
if: github.event_name == 'release'
with:
image_name: ${{ env.IMAGE_NAME }}
image_tag: ${{ env.RELEASE }}
username: gadockersvc
password: "${{ secrets.DockerPassword }}"
build_extra_args: "--build-arg=ENVIRONMENT=deployment"
- name: Update Docker Hub Description
uses: peter-evans/dockerhub-description@v4
with:
username: gadockersvc
password: ${{ secrets.DockerPassword }}
repository: ${{ env.IMAGE_NAME }}
readme-filepath: README.md
short-description: Open Data Cube Explorer Image