Files
ThreadNet-Web/.github/workflows/cd.yaml
T
renovate[bot]GitHubrenovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
a9dcdc067b Update github-actions non-major dependencies (#34535)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-08-04 08:41:23 +00:00

83 lines
3.0 KiB
YAML

name: CD # Continuous Delivery
on:
push:
branches: [master, staging, develop]
paths:
- "**/Dockerfile"
- "**/dockerbuild"
- "**/docker"
- "**/docker-*"
- "pnpm-lock.yaml"
concurrency: ${{ github.workflow }}-${{ github.ref_name }}
permissions: {}
env:
NX_DEFAULT_OUTPUT_STYLE: stream-without-prefixes
jobs:
docker:
name: Docker Bake
runs-on: ubuntu-24.04
permissions:
id-token: write # needed for signing the images with GitHub OIDC Token
packages: write # needed for publishing packages to GHCR
# Needed for nx-set-shas
contents: read
actions: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
- name: Install Cosign
uses: sigstore/cosign-installer@6f9f17788090df1f26f669e9d70d6ae9567deba6 # v4.1.2
- name: Set up QEMU
uses: docker/setup-qemu-action@96fe6ef7f33517b61c61be40b68a1882f3264fb8 # v4
- name: Set up Docker Buildx
id: builder
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4
- uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
with:
node-version-file: package.json
cache: "pnpm"
- name: Install Deps
run: "pnpm install --frozen-lockfile"
- name: Login to GitHub Container Registry
uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
# Fudge and run this separately rather than relying on the dependency,
# otherwise nx does not appear to pick up the .env file that playwright
# common's prebuild step creates.
- run: pnpm nx run-many --nxBail -t docker:prebuild
env:
INPUT_BUILDER: ${{ steps.builder.outputs.name }}
- run: pnpm nx run-many --nxBail -t docker:build
id: build
env:
INPUT_PUSH: true
INPUT_LOAD: false
INPUT_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
INPUT_BUILDER: ${{ steps.builder.outputs.name }}
- name: Sign the images with GitHub OIDC token
run: |
shopt -s globstar
for FILE in ./node_modules/.cache/nx-container/**/metadata; do
TARGET=$(jq -r '(.["image.name"] | split(",") | last) + "@" + .["containerimage.digest"]' "$FILE")
echo "Signing $TARGET..."
cosign sign --yes "$TARGET"
done