Build and push multi-arch image #292
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and push images | |
on: | |
workflow_dispatch: | |
inputs: | |
buildType: | |
description: Decide on what to build | |
required: true | |
type: choice | |
options: | |
- build_push_ckan | |
- build_only | |
- build_push_base | |
- build_push_pycsw | |
- build_push_solr | |
- build_push_test_ckan | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: '0 3 * * 0' | |
jobs: | |
build_and_push: | |
name: ${{ inputs.buildType }}=${{ matrix.app.name }}:${{ matrix.app.version }}-${{ matrix.app.patch }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
# remember to update versions on build-image-on-tags.yaml | |
app: | |
- name: ckan | |
version: 2.10.4 | |
patch: c | |
- name: pycsw | |
version: 2.6.1 | |
patch: j | |
- name: solr | |
version: "2.10" | |
patch: a | |
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.buildType == 'build_only' }} | |
env: | |
DRY_RUN: "1" | |
APP: ${{ matrix.app.name }} | |
VERSION: ${{ matrix.app.version }} | |
ARCH: ${{ matrix.arch }} | |
run: ./docker/build-image.sh | |
- name: Build and push CKAN image | |
if: ${{ (inputs.buildType == 'build_push_ckan' || github.ref == 'refs/heads/main') && matrix.app.name == 'ckan' }} | |
env: | |
APP: ${{ matrix.app.name }} | |
VERSION: ${{ matrix.app.version }} | |
REPO_OWNER: ${{ github.repository_owner }} | |
ARCH: ${{ matrix.arch }} | |
run: ./docker/build-image.sh | |
- name: Build and push CKAN base and core image | |
if: ${{ inputs.buildType == 'build_push_base' && matrix.app.name == 'ckan' }} | |
env: | |
APP: ${{ matrix.app.name }} | |
VERSION: ${{ matrix.app.version }} | |
PATCH: ${{ matrix.app.patch }} | |
REPO_OWNER: ${{ github.repository_owner }} | |
ARCH: ${{ matrix.arch }} | |
BUILD_BASE: true | |
run: ./docker/build-image.sh | |
- name: Build and push pycsw image | |
if: ${{ inputs.buildType == 'build_push_pycsw' && matrix.app.name == 'pycsw' }} | |
env: | |
APP: ${{ matrix.app.name }} | |
VERSION: ${{ matrix.app.version }} | |
PATCH: ${{ matrix.app.patch }} | |
REPO_OWNER: ${{ github.repository_owner }} | |
ARCH: ${{ matrix.arch }} | |
BUILD_BASE: true | |
run: ./docker/build-image.sh | |
- name: Build and push solr image | |
if: ${{ inputs.buildType == 'build_push_solr' && matrix.app.name == 'solr' }} | |
env: | |
APP: ${{ matrix.app.name }} | |
VERSION: ${{ matrix.app.version }} | |
PATCH: ${{ matrix.app.patch }} | |
REPO_OWNER: ${{ github.repository_owner }} | |
ARCH: ${{ matrix.arch }} | |
GH_REF: ${{ matrix.app.version }} | |
BUILD_BASE: false | |
run: ./docker/build-image.sh | |
- name: Build and push CKAN test image | |
if: ${{ inputs.buildType == 'build_push_test_ckan' && matrix.app.name == 'ckan' }} | |
env: | |
APP: ${{ matrix.app.name }} | |
VERSION: '2.9.9' | |
REPO_OWNER: ${{ github.repository_owner }} | |
TAG: '2.9.9-test-d' | |
ARCH: ${{ matrix.arch }} | |
BUILD_BASE: true | |
run: ./docker/build-image.sh |