CI: build the Lyrica image only when ./lyrica changes (its own workflow), so a Docker Hub timeout cannot fail the main build
This commit is contained in:
1 parent
c82bd7cae9
commit
ae00f61711
2 files changed
+37
-18
No files matched your search
@@ -0,0 +1,37 @@
|
|||||||
|
name: build-lyrics-container
|
||||||
|
|
||||||
|
# The lyrics container (Lyrica, pinned to one commit) only changes when ./lyrica does, so it is built only then (or by hand with "Run workflow").
|
||||||
|
# Building it on every push meant a needless restart of the lyrics service each time, and a failed pull of its Python base image failed the whole run.
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
paths: ['lyrica/**', '.gitea/workflows/build-lyrica.yml']
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: docker/setup-buildx-action@v3
|
||||||
|
- uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: git.necloud.us
|
||||||
|
username: ${{ secrets.REGISTRY_USER || gitea.actor }}
|
||||||
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||||
|
- id: meta_ly
|
||||||
|
uses: docker/metadata-action@v5
|
||||||
|
with:
|
||||||
|
images: git.necloud.us/nate/hub-lyrica
|
||||||
|
tags: |
|
||||||
|
type=raw,value=latest,enable={{is_default_branch}}
|
||||||
|
type=sha,format=short
|
||||||
|
- uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
context: ./lyrica
|
||||||
|
platforms: linux/amd64
|
||||||
|
push: true
|
||||||
|
tags: ${{ steps.meta_ly.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta_ly.outputs.labels }}
|
||||||
|
cache-from: type=registry,ref=git.necloud.us/nate/hub-lyrica:buildcache
|
||||||
|
cache-to: type=registry,ref=git.necloud.us/nate/hub-lyrica:buildcache,mode=max
|
||||||
@@ -64,21 +64,3 @@ jobs:
|
|||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
cache-from: type=registry,ref=git.necloud.us/nate/hub:buildcache
|
cache-from: type=registry,ref=git.necloud.us/nate/hub:buildcache
|
||||||
cache-to: type=registry,ref=git.necloud.us/nate/hub:buildcache,mode=max
|
cache-to: type=registry,ref=git.necloud.us/nate/hub:buildcache,mode=max
|
||||||
|
|
||||||
# The lyrics container (Lyrica, pinned)
|
|
||||||
- id: meta_ly
|
|
||||||
uses: docker/metadata-action@v5
|
|
||||||
with:
|
|
||||||
images: git.necloud.us/nate/hub-lyrica
|
|
||||||
tags: |
|
|
||||||
type=raw,value=latest,enable={{is_default_branch}}
|
|
||||||
type=sha,format=short
|
|
||||||
type=ref,event=tag
|
|
||||||
|
|
||||||
- uses: docker/build-push-action@v6
|
|
||||||
with:
|
|
||||||
context: ./lyrica
|
|
||||||
platforms: linux/amd64
|
|
||||||
push: true
|
|
||||||
tags: ${{ steps.meta_ly.outputs.tags }}
|
|
||||||
labels: ${{ steps.meta_ly.outputs.labels }}
|
|
||||||
Reference in new issue
Block a user