Skip to content

Build and push images #188

Build and push images

Build and push images #188

Workflow file for this run

name: Build and push images
on:
workflow_dispatch:
inputs:
buildType:
description: Decide on what to build
required: true
type: choice
options:
- build_push
- build_only
- build_push_base
- build_push_pycsw
- build_push_test_ckan
push:
branches:
- main
schedule:
- cron: '0 3 * * 0'
jobs:
build_and_push:
name: ${{ matrix.app.name }} (${{ matrix.arch }})
runs-on: ubuntu-latest
strategy:
matrix:
# remember to update versions on build-image-on-tags.yaml
app:
- name: ckan
version: 2.9.9
- name: pycsw
version: 2.6.1
skip: true
- name: pycsw
version: 2.4.2
- name: solr
version: 8-2.9f
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 images
if: ${{ inputs.buildType == 'build_push' || github.ref == 'refs/heads/main' }}
env:
APP: ${{ matrix.app.name }}
VERSION: ${{ matrix.app.version }}
ARCH: ${{ matrix.arch }}
SKIP: ${{ matrix.app.skip }}
run: ./docker/build-image.sh
- name: Build and push CKAN base image
if: ${{ inputs.buildType == 'build_push_base' && matrix.app.name == 'ckan' }}
env:
APP: ${{ matrix.app.name }}
VERSION: ${{ matrix.app.version }}
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 }}
ARCH: ${{ matrix.arch }}
BUILD_BASE: true
SKIP: ${{ matrix.app.skip }}
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'
TAG: '2.9.9-test-d'
ARCH: ${{ matrix.arch }}
BUILD_BASE: true
run: ./docker/build-image.sh