mirror of
https://github.com/qurator-spk/ocrd-galley.git
synced 2025-06-09 06:39:53 +02:00
🚧 github: Reuse subimage workflow
This commit is contained in:
parent
9b2b68ce2d
commit
f1081cb721
2 changed files with 23 additions and 28 deletions
16
.github/workflows/build-subimage.yml
vendored
16
.github/workflows/build-subimage.yml
vendored
|
@ -7,10 +7,6 @@ on:
|
||||||
tags:
|
tags:
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
cache-from:
|
|
||||||
required: false
|
|
||||||
type: string
|
|
||||||
default:
|
|
||||||
secrets:
|
secrets:
|
||||||
DOCKERHUB_USERNAME:
|
DOCKERHUB_USERNAME:
|
||||||
required: true
|
required: true
|
||||||
|
@ -30,6 +26,14 @@ jobs:
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v2
|
||||||
|
-
|
||||||
|
name: Docker meta
|
||||||
|
id: meta
|
||||||
|
uses: docker/metadata-action@v4
|
||||||
|
with:
|
||||||
|
images: |
|
||||||
|
quratorspk/ocrd-galley-${{ inputs.subimage }}
|
||||||
|
tags: ${{ inputs.tags }}
|
||||||
-
|
-
|
||||||
name: Login to Docker Hub
|
name: Login to Docker Hub
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v2
|
||||||
|
@ -44,7 +48,7 @@ jobs:
|
||||||
file: Dockerfile-${{ inputs.subimage }}
|
file: Dockerfile-${{ inputs.subimage }}
|
||||||
build-args:
|
build-args:
|
||||||
DRONE_COMMIT=${{ github.sha }}
|
DRONE_COMMIT=${{ github.sha }}
|
||||||
tags: ${{ inputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
push: true
|
push: true
|
||||||
|
|
||||||
cache-from: ${{ inputs.cache-from }}
|
cache-from: quratorspk/ocrd-galley-${{ inputs.subimage }}:${{ github.sha }}
|
||||||
|
|
35
.github/workflows/build.yml
vendored
35
.github/workflows/build.yml
vendored
|
@ -18,7 +18,8 @@ jobs:
|
||||||
uses: ./.github/workflows/build-subimage.yml
|
uses: ./.github/workflows/build-subimage.yml
|
||||||
with:
|
with:
|
||||||
subimage: ${{ matrix.subimage }}
|
subimage: ${{ matrix.subimage }}
|
||||||
tags: quratorspk/ocrd-galley-${{ matrix.subimage }}:${{ github.sha }}
|
tags: |
|
||||||
|
type=sha,format=long
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|
||||||
build-rest:
|
build-rest:
|
||||||
|
@ -29,7 +30,8 @@ jobs:
|
||||||
uses: ./.github/workflows/build-subimage.yml
|
uses: ./.github/workflows/build-subimage.yml
|
||||||
with:
|
with:
|
||||||
subimage: ${{ matrix.subimage }}
|
subimage: ${{ matrix.subimage }}
|
||||||
tags: quratorspk/ocrd-galley-${{ matrix.subimage }}:${{ github.sha }}
|
tags: |
|
||||||
|
type=sha,format=long
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|
||||||
|
|
||||||
|
@ -58,27 +60,16 @@ jobs:
|
||||||
# tags. We do this by building again, but using the formerly built images to
|
# tags. We do this by building again, but using the formerly built images to
|
||||||
# cache from.
|
# cache from.
|
||||||
|
|
||||||
tag:
|
push-with-tags:
|
||||||
needs: test
|
needs: test
|
||||||
runs-on: ubuntu-latest
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
subimage: ["core", "dinglehopper"]
|
subimage: ["core", "dinglehopper"]
|
||||||
# TODO have one list, not multiple
|
uses: ./.github/workflows/build-subimage.yml
|
||||||
steps:
|
with:
|
||||||
-
|
subimage: ${{ matrix.subimage }}
|
||||||
name: Docker meta
|
tags: |
|
||||||
id: meta
|
type=sha,format=long
|
||||||
uses: docker/metadata-action@v4
|
type=ref,event=tag
|
||||||
with:
|
use-cache: true
|
||||||
images: |
|
secrets: inherit
|
||||||
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 }}
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue