You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ocrd-galley/.github/workflows/build.yml

85 lines
2.0 KiB
YAML

name: build
on:
workflow_dispatch:
push:
branches:
- 'master'
- 'test/github-actions'
jobs:
build-core:
strategy:
matrix:
subimage: ["core"]
uses: ./.github/workflows/build-subimage.yml
with:
subimage: ${{ matrix.subimage }}
tags: quratorspk/ocrd-galley-${{ matrix.subimage }}:${{ github.sha }}
secrets: inherit
build-rest:
needs: build-core
strategy:
matrix:
subimage: ["dinglehopper"]
uses: ./.github/workflows/build-subimage.yml
with:
subimage: ${{ matrix.subimage }}
tags: quratorspk/ocrd-galley-${{ matrix.subimage }}:${{ github.sha }}
secrets: inherit
test:
needs: build-rest
runs-on: ubuntu-latest
env:
DOCKER_IMAGE_TAG: ${{ github.sha }} # needed to run the correct version through the wrapper
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Install wrapper
run: |
sudo apt-get install -y python3-pip
cd wrapper && pip install .
-
name: Test
run: |
ocrd --version
ocrd-dinglehopper --version
# At this point, we have successfully built, uploaded and tested the images. We now just need to add
# tags. We do this by building again, but using the formerly built images to
# cache from.
tag:
needs: test
runs-on: ubuntu-latest
strategy:
matrix:
subimage: ["core", "dinglehopper"]
# TODO have one list, not multiple
steps:
-
name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
quratorspk/ocrd-galley-${{ matrix.subimage }}
tags: |
type=ref,event=branch
-
name: Push with tags (from cache)
uses: ./.github/workflows/build-subimage.yml
with:
subimage: ${{ matrix.subimage }}
cache-from: quratorspk/ocrd-galley-${{ matrix.subimage }}:${{ github.sha }}
tags: ${{ steps.meta.outputs.tags }}