-
Notifications
You must be signed in to change notification settings - Fork 11
65 lines (63 loc) · 1.86 KB
/
build-image.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Build and push images
on:
workflow_dispatch:
inputs:
noPushToRegistry:
description: Build only, skip pushing to registry
required: true
type: boolean
default: false
buildBaseImages:
description: Build base images
required: true
type: boolean
default: false
push:
branches:
- main
schedule:
- cron: '0 3 * * 0'
jobs:
build_and_push:
name: ${{ matrix.app.name }} (${{ matrix.arch }})
runs-on: ubuntu-latest
strategy:
matrix:
app:
- name: ckan
version: 2.9.9
- name: pycsw
version: 2.6.1
- name: postgis
version: 13-3.1
- name: solr
version: 8
arch: [ amd64 ]
permissions:
packages: write
steps:
- name: Login to GHCR
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v3
with:
ref: ${{ inputs.gitRef }}
- name: Build images (without pushing to registry)
if: ${{ inputs.noPushToRegistry }}
env:
DRY_RUN: "1"
APP: ${{ matrix.app.name }}
VERSION: ${{ matrix.app.version }}
ARCH: ${{ matrix.arch }}
run: ./docker/build-image.sh
- name: Build and push images
if: ${{ (!inputs.noPushToRegistry && !inputs.buildBaseImages) || (!inputs.noPushToRegistry && inputs.buildBaseImages && (matrix.app.name == 'ckan' || matrix.app.name == 'solr') ) }}
env:
APP: ${{ matrix.app.name }}
VERSION: ${{ matrix.app.version }}
ARCH: ${{ matrix.arch }}
BUILD_BASE: ${{ inputs.buildBaseImages }}
run: ./docker/build-image.sh