-
Notifications
You must be signed in to change notification settings - Fork 20
45 lines (39 loc) · 1.38 KB
/
xcube_build_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
name: xcube docker build
on:
workflow_dispatch:
env:
APP_NAME: xcube
ORG_NAME: bcdev
IMG_REG_NAME: quay.io
jobs:
build-docker-image-and-push:
runs-on: ubuntu-latest
# Build the docker image and push to quay.io
name: build-docker-image
steps:
# Determine latest release tag
- name: Get latest release
id: latest_release
run: |
LATEST_RELEASE=$(curl --silent "https://api.github.com/repos/dcs4cop/xcube/releases/latest" | jq -r .tag_name)
echo "::set-output name=release_tag::$LATEST_RELEASE"
# checkout the repo with the release tag from previous step
- name: git-checkout
uses: actions/checkout@v4
with:
ref: ${{ steps.latest_release.outputs.release_tag }}
# Print some info
- name: info
id: info
run: |
echo "TAG: ${{ steps.latest_release.outputs.release_tag }}"
echo "EVENT: ${{ github.event_name }}"
# Build and push docker release to quay.io
- name: push-docker-image-with-release-tag
uses: mr-smithers-excellent/docker-build-push@v6
with:
image: ${{ env.ORG_NAME }}/${{ env.APP_NAME }}
tags: ${{ steps.latest_release.outputs.release_tag }}
registry: ${{ env.IMG_REG_NAME }}
username: ${{ secrets.IMG_REG_USERNAME }}
password: ${{ secrets.IMG_REG_PASSWORD }}