ci: push UI then API, move latest last; OCI source label; pin nginx base by digest
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci / pre-commit (pull_request) Has been cancelled
ci / lint (pull_request) Has been cancelled
ci / test (pull_request) Has been cancelled
ci / build (pull_request) Has been cancelled
ci / ui (pull_request) Has been cancelled

- Build UI dist and push the UI image before the API image, and tag
  latest on both only after both versioned tags exist.
- Label both images org.opencontainers.image.source so ghcr links the
  packages to the repo.
- Pin nginx:alpine by digest in scripts/ui-image.sh and ui/Dockerfile.ui.
- Release trigger narrowed to v[0-9]* tags.
This commit is contained in:
2026-11-20 22:24:05 +11:00
parent a33e07785e
commit e3a9b019c0
3 changed files with 21 additions and 14 deletions
+14 -7
View File
@@ -2,7 +2,7 @@ name: release
on:
push:
tags: ["v*"]
tags: ["v[0-9]*"]
permissions:
contents: read
@@ -27,16 +27,23 @@ jobs:
- run: echo "${GITHUB_TOKEN}" | crane auth login ghcr.io -u "${GITHUB_ACTOR}" --password-stdin
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: API image
run: ko build --bare --sbom=none --platform linux/amd64 --tags "${GITHUB_REF_NAME},latest" ./cmd/artifactapi
env:
KO_DOCKER_REPO: ghcr.io/iuclabs/artifactapi
VERSION: ${{ github.ref_name }}
- run: npm ci && npm run build
working-directory: ui
env:
BASE_PATH: /ui
- name: UI image
run: scripts/ui-image.sh "ghcr.io/iuclabs/artifactapi-ui:${GITHUB_REF_NAME}" latest
run: scripts/ui-image.sh "ghcr.io/iuclabs/artifactapi-ui:${GITHUB_REF_NAME}"
env:
BASE_PATH: /ui
- name: API image
run: >-
ko build --bare --sbom=none --platform linux/amd64 --tags "${GITHUB_REF_NAME}"
--image-label org.opencontainers.image.source=https://github.com/IUCLabs/artifactapi
./cmd/artifactapi
env:
KO_DOCKER_REPO: ghcr.io/iuclabs/artifactapi
VERSION: ${{ github.ref_name }}
- name: Move latest
run: |
crane tag "ghcr.io/iuclabs/artifactapi-ui:${GITHUB_REF_NAME}" latest
crane tag "ghcr.io/iuclabs/artifactapi:${GITHUB_REF_NAME}" latest