Skip to content

Modern Docker Management, Designed for Everyone

ci/cd: workflow refactors and tweaks

Kyle Mendelld8f8d53816d5
diff --git a/.github/workflows/backend-tests.yml b/.github/workflows/backend-tests.yml
index de99362e5..de2bf796a 100644
--- a/.github/workflows/backend-tests.yml
+++ b/.github/workflows/backend-tests.yml
@@ -10,9 +10,13 @@ on:
paths:
- "backend/**"
+permissions:
+ contents: read
+
jobs:
test:
runs-on: depot-ubuntu-latest
+ timeout-minutes: 30
defaults:
run:
working-directory: backend
@@ -21,11 +25,15 @@ jobs:
- name: Checkout
uses: actions/checkout@v5
+ - name: Set up Depot CLI
+ uses: depot/setup-action@v1
+
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version-file: backend/go.mod
cache: true
+ cache-dependency-path: backend/go.sum
- name: Install GCC
run: |
diff --git a/.github/workflows/build-next-images.yml b/.github/workflows/build-next-images.yml
index d9e134800..84b9842b4 100644
--- a/.github/workflows/build-next-images.yml
+++ b/.github/workflows/build-next-images.yml
@@ -105,6 +105,7 @@ jobs:
file: ${{ matrix.dockerfile }}
sbom: true
sbom-dir: sbom-output/${{ matrix.target }}
+ provenance: true
- name: Upload SBOM artifact (${{ matrix.display }})
uses: actions/upload-artifact@v5
diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml
index 6d64886b4..a3acf10e5 100644
--- a/.github/workflows/e2e-tests.yml
+++ b/.github/workflows/e2e-tests.yml
@@ -5,18 +5,17 @@ on:
branches: [main]
paths-ignore:
- "**.md"
- - ".github/**"
pull_request:
branches: [main]
paths-ignore:
- "**.md"
- - ".github/**"
permissions:
contents: read
actions: read
checks: write
pull-requests: write
+ id-token: write
concurrency:
group: "${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.pull_request.number) || github.ref }}"
@@ -29,24 +28,28 @@ jobs:
permissions:
contents: read
actions: write
+ id-token: write
runs-on: depot-ubuntu-latest
steps:
- uses: actions/checkout@v5
- - name: Set up Docker Buildx
- uses: docker/setup-buildx-action@v3
+ - name: Set up Depot CLI
+ uses: depot/setup-action@v1
- - name: Build and export Arcane image
- uses: docker/build-push-action@v6
+ - name: Build Arcane image for Playwright
+ uses: depot/build-push-action@v1
with:
- push: false
- load: false
- tags: arcane:playwright-tests
+ context: .
file: docker/Dockerfile
- build-args: BUILD_TAGS=playwright
- outputs: type=docker,dest=/tmp/arcane-image.tar
- cache-from: type=gha
- cache-to: type=gha,mode=max
+ load: true
+ tags: arcane:playwright-tests
+ build-args: |
+ BUILD_TAGS=playwright
+ provenance: true
+ sbom: true
+
+ - name: Export image to tarball
+ run: docker save arcane:playwright-tests -o /tmp/arcane-image.tar
- name: Upload Docker image artifact
uses: actions/upload-artifact@v5
@@ -81,11 +84,14 @@ jobs:
- name: Setup pnpm
uses: pnpm/action-setup@v4
+ with:
+ run_install: false
- name: Setup Node.js
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 #v5.0.0
+ uses: actions/setup-node@v6
with:
node-version: 24
+ cache: pnpm
- name: Cache Playwright Browsers
uses: actions/cache@v4
diff --git a/.github/workflows/go-linter.yml b/.github/workflows/go-linter.yml
index 7271e8493..d406e946c 100644
--- a/.github/workflows/go-linter.yml
+++ b/.github/workflows/go-linter.yml
@@ -27,8 +27,7 @@ jobs:
uses: actions/setup-go@v6
with:
go-version-file: backend/go.mod
- cache-dependency-path: |
- backend/go.sum
+ cache-dependency-path: backend/go.sum
- name: Run Golangci-lint
uses: golangci/golangci-lint-action@v9
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 5d443d381..b68f5b7c4 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -27,11 +27,14 @@ jobs:
- name: Setup PNPM
uses: pnpm/action-setup@v4
+ with:
+ run_install: false
- name: Setup Node.js
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 #v5.0.0
+ uses: actions/setup-node@v6
with:
node-version: 24
+ cache: pnpm
- name: Install frontend deps
run: pnpm -C frontend install --frozen-lockfile
@@ -62,10 +65,22 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload ${{ github.ref_name }} backend/.bin/*
- manager-image:
+ images:
runs-on: depot-ubuntu-latest
- env:
- DOCKER_IMAGE_NAME: ghcr.io/${{ github.repository_owner }}/arcane
+ strategy:
+ fail-fast: false
+ matrix:
+ include:
+ - target: manager
+ display: Arcane
+ dockerfile: docker/Dockerfile
+ image-suffix: arcane
+ sbom-dir: manager
+ - target: agent
+ display: Arcane Headless
+ dockerfile: docker/Dockerfile-agent
+ image-suffix: arcane-headless
+ sbom-dir: agent
steps:
- uses: actions/checkout@v5
with: { fetch-depth: 1 }
@@ -73,27 +88,33 @@ jobs:
- name: Set up Depot CLI
uses: depot/setup-action@v1
- - name: Lowercase image name
- run: echo "DOCKER_IMAGE_NAME=${DOCKER_IMAGE_NAME,,}" >> "$GITHUB_ENV"
+ - name: Resolve image name
+ id: image-name
+ run: |
+ OWNER=${{ github.repository_owner }}
+ echo "value=ghcr.io/${OWNER,,}/${{ matrix.image-suffix }}" >> "$GITHUB_OUTPUT"
+
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
+
- id: meta
uses: docker/metadata-action@v5
with:
- images: ${{ env.DOCKER_IMAGE_NAME }}
+ images: ${{ steps.image-name.outputs.value }}
tags: |
type=semver,pattern={{version}},prefix=v
type=semver,pattern={{major}}.{{minor}},prefix=v
type=semver,pattern={{major}},prefix=v
+
- id: build
uses: depot/build-push-action@v1
with:
token: ${{ secrets.DEPOT_TOKEN }}
context: .
- file: docker/Dockerfile
+ file: ${{ matrix.dockerfile }}
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
@@ -103,56 +124,24 @@ jobs:
REVISION=${{ github.sha }}
secrets: |
"DEPOT_TOKEN=${{ secrets.DEPOT_TOKEN }}"
- outputs:
- digest: ${{ steps.build.outputs.digest }}
+ sbom: true
+ sbom-dir: sbom-output/${{ matrix.target }}
+ provenance: true
- agent-image:
- runs-on: depot-ubuntu-latest
- env:
- AGENT_IMAGE_NAME: ghcr.io/${{ github.repository_owner }}/arcane-headless
- steps:
- - uses: actions/checkout@v5
- with: { fetch-depth: 1 }
+ - name: Record digest
+ run: |
+ mkdir -p sbom-output/${{ matrix.target }}
+ echo "${{ steps.build.outputs.digest }}" > sbom-output/${{ matrix.target }}/digest.txt
- - name: Set up Depot CLI
- uses: depot/setup-action@v1
-
- - name: Lowercase image name
- run: echo "AGENT_IMAGE_NAME=${AGENT_IMAGE_NAME,,}" >> "$GITHUB_ENV"
- - uses: docker/login-action@v3
- with:
- registry: ghcr.io
- username: ${{ github.repository_owner }}
- password: ${{ secrets.GITHUB_TOKEN }}
- - id: meta
- uses: docker/metadata-action@v5
+ - name: Upload SBOM artifact (${{ matrix.display }})
+ uses: actions/upload-artifact@v5
with:
- images: ${{ env.AGENT_IMAGE_NAME }}
- tags: |
- type=semver,pattern={{version}},prefix=v
- type=semver,pattern={{major}}.{{minor}},prefix=v
- type=semver,pattern={{major}},prefix=v
- - id: build
- uses: depot/build-push-action@v1
- with:
- token: ${{ secrets.DEPOT_TOKEN }}
- context: .
- file: docker/Dockerfile-agent
- platforms: linux/amd64,linux/arm64
- push: true
- tags: ${{ steps.meta.outputs.tags }}
- labels: ${{ steps.meta.outputs.labels }}
- build-args: |
- VERSION=${{ github.ref_name }}
- REVISION=${{ github.sha }}
- secrets: |
- "DEPOT_TOKEN=${{ secrets.DEPOT_TOKEN }}"
- outputs:
- digest: ${{ steps.build.outputs.digest }}
+ path: sbom-output/${{ matrix.target }}
+ name: SBOM-${{ matrix.target }}
publish-release:
runs-on: depot-ubuntu-latest
- needs: [binaries, manager-image, agent-image]
+ needs: [binaries, images]
permissions:
contents: write
id-token: write
@@ -167,17 +156,32 @@ jobs:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
+ - name: Download manager SBOM and digest
+ uses: actions/download-artifact@v5
+ with:
+ name: SBOM-manager
+ path: sbom-artifacts/manager
+ - name: Download agent SBOM and digest
+ uses: actions/download-artifact@v5
+ with:
+ name: SBOM-agent
+ path: sbom-artifacts/agent
+ - name: Read digests
+ id: digests
+ run: |
+ echo "manager=$(cat sbom-artifacts/manager/digest.txt)" >> "$GITHUB_OUTPUT"
+ echo "agent=$(cat sbom-artifacts/agent/digest.txt)" >> "$GITHUB_OUTPUT"
- name: Container image attestation (manager)
uses: actions/attest-build-provenance@v3
with:
subject-name: ghcr.io/${{ github.repository_owner }}/arcane
- subject-digest: ${{ needs.manager-image.outputs.digest }}
+ subject-digest: ${{ steps.digests.outputs.manager }}
push-to-registry: true
- name: Container image attestation (agent)
uses: actions/attest-build-provenance@v3
with:
subject-name: ghcr.io/${{ github.repository_owner }}/arcane-headless
- subject-digest: ${{ needs.agent-image.outputs.digest }}
+ subject-digest: ${{ steps.digests.outputs.agent }}
push-to-registry: true
- name: Publish release
env:
diff --git a/.github/workflows/svelte-check.yml b/.github/workflows/svelte-check.yml
index fb79853e6..b02027a2e 100644
--- a/.github/workflows/svelte-check.yml
+++ b/.github/workflows/svelte-check.yml
@@ -26,8 +26,6 @@ on:
jobs:
type-check:
name: Run Svelte Check
- # Don't run on dependabot branches
- if: github.actor != 'dependabot[bot]'
runs-on: depot-ubuntu-latest
permissions:
contents: read
@@ -42,9 +40,10 @@ jobs:
uses: pnpm/action-setup@v4
- name: Setup Node.js
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 #v5.0.0
+ uses: actions/setup-node@v6
with:
node-version: 24
+ cache: pnpm
- name: Install dependencies
run: pnpm --filter arcane-frontend install --frozen-lockfile