-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (52 loc) · 2.3 KB
/
containers.yml
File metadata and controls
67 lines (52 loc) · 2.3 KB
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
name: Create containers
on:
# run every night
schedule:
- cron: "0 22 * * *"
# schedule manually
workflow_dispatch:
inputs:
# On workflow dispatch, `branch` is selected by default
# You can access it in `github.ref_name`
tag_name:
description: "Tag name for the container"
required: true
default: "nightly"
container_repository_branch:
description: "Branch of the container repository"
required: true
default: "main"
jobs:
build-and-push-containers:
name: Build and push container images to Quay
if: github.event_name != 'schedule' || github.repository_owner == 'geo-engine'
runs-on: ubuntu-24.04
permissions:
contents: read
env:
TAG_NAME: nightly
BACKEND_CONTAINER_NAME: biois-backend
FRONTEND_CONTAINER_NAME: biois-frontend
steps:
- uses: extractions/setup-just@v3
- name: Modify TAG_NAME if on `tag_name` is set on `workflow_dispatch`
if: github.event.inputs.tag_name != ''
run: |
echo "TAG_NAME=${{ github.event.inputs.tag_name }}" >> $GITHUB_ENV
- name: Checkout code
uses: actions/checkout@v6
- name: Login to quay.io
run: podman login -u="geoengine+bot" -p="${{secrets.QUAY_IO_TOKEN}}" quay.io
- name: Build containers
run: |
just build-backend-container
just build-frontend-container
- name: Push image to quay.io
run: |
podman push ${{env.BACKEND_CONTAINER_NAME}}:latest quay.io/geoengine/${{env.BACKEND_CONTAINER_NAME}}:${{env.TAG_NAME}}
podman push ${{env.FRONTEND_CONTAINER_NAME}}:latest quay.io/geoengine/${{env.FRONTEND_CONTAINER_NAME}}:${{env.TAG_NAME}}
- name: Push nightly with date
if: env.TAG_NAME == 'nightly'
run: |
podman push ${{env.BACKEND_CONTAINER_NAME}}:latest quay.io/geoengine/${{env.BACKEND_CONTAINER_NAME}}:${{env.TAG_NAME}}-$(date +'%Y-%m-%d')
podman push ${{env.FRONTEND_CONTAINER_NAME}}:latest quay.io/geoengine/${{env.FRONTEND_CONTAINER_NAME}}:${{env.TAG_NAME}}-$(date +'%Y-%m-%d')