mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2026-09-29 16:24:22 +10:00
ci: default to GitHub-hosted runners with opt-in Blacksmith
Workflows now run on GitHub-hosted runners unless the repository variable USE_BLACKSMITH is "true", so forks work without setup. When enabled, jobs run on Blacksmith runners (32 vCPU for build/test, 2 vCPU for lightweight jobs) and use useblacksmith/checkout, useblacksmith/setup-docker-builder, and useblacksmith/build-push-action. Docker layer caches are keyed per architecture. Replaces the CI_RUNNER_X64 and CI_RUNNER_ARM64 variables.
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
self-hosted-runner:
|
self-hosted-runner:
|
||||||
labels:
|
labels:
|
||||||
|
- blacksmith-2vcpu-ubuntu-2404
|
||||||
- blacksmith-32vcpu-ubuntu-2404
|
- blacksmith-32vcpu-ubuntu-2404
|
||||||
- blacksmith-32vcpu-ubuntu-2404-arm
|
- blacksmith-32vcpu-ubuntu-2404-arm
|
||||||
|
|||||||
@@ -13,12 +13,17 @@ env:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
autofix:
|
autofix:
|
||||||
runs-on: ${{ vars.CI_RUNNER_X64 || 'ubuntu-latest' }}
|
runs-on: ${{ vars.USE_BLACKSMITH == 'true' && 'blacksmith-32vcpu-ubuntu-2404' || 'ubuntu-latest' }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Repository
|
- name: Checkout Repository
|
||||||
|
if: ${{ vars.USE_BLACKSMITH != 'true' }}
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
|
- name: Checkout Repository (Blacksmith)
|
||||||
|
if: ${{ vars.USE_BLACKSMITH == 'true' }}
|
||||||
|
uses: useblacksmith/checkout@v1
|
||||||
|
|
||||||
- name: Check for merge conflict markers
|
- name: Check for merge conflict markers
|
||||||
run: |
|
run: |
|
||||||
if git grep -nEI '<{7} |>{7} |^={7}$' -- ':(exclude)*.md' ':(exclude)*.mdx'; then
|
if git grep -nEI '<{7} |>{7} |^={7}$' -- ':(exclude)*.md' ':(exclude)*.mdx'; then
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ concurrency:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
crowdin-sync:
|
crowdin-sync:
|
||||||
runs-on: ${{ vars.CI_RUNNER_X64 || 'ubuntu-latest' }}
|
runs-on: ${{ vars.USE_BLACKSMITH == 'true' && 'blacksmith-2vcpu-ubuntu-2404' || 'ubuntu-latest' }}
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
@@ -18,8 +18,16 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Repository
|
- name: Checkout Repository
|
||||||
|
if: ${{ vars.USE_BLACKSMITH != 'true' }}
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
|
# The Crowdin action runs in a container that cannot reach the git mirror mount, so copy its objects.
|
||||||
|
- name: Checkout Repository (Blacksmith)
|
||||||
|
if: ${{ vars.USE_BLACKSMITH == 'true' }}
|
||||||
|
uses: useblacksmith/checkout@v1
|
||||||
|
with:
|
||||||
|
dissociate: true
|
||||||
|
|
||||||
- name: Sync Translations from Crowdin
|
- name: Sync Translations from Crowdin
|
||||||
uses: crowdin/github-action@v2
|
uses: crowdin/github-action@v2
|
||||||
with:
|
with:
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ env:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
mode:
|
mode:
|
||||||
runs-on: ${{ vars.CI_RUNNER_X64 || 'ubuntu-latest' }}
|
runs-on: ${{ vars.USE_BLACKSMITH == 'true' && 'blacksmith-2vcpu-ubuntu-2404' || 'ubuntu-latest' }}
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
nightly: ${{ steps.mode.outputs.nightly }}
|
nightly: ${{ steps.mode.outputs.nightly }}
|
||||||
@@ -61,10 +61,10 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- platform: linux/amd64
|
- platform: linux/amd64
|
||||||
runner: ${{ vars.CI_RUNNER_X64 || 'ubuntu-latest' }}
|
runner: ${{ vars.USE_BLACKSMITH == 'true' && 'blacksmith-32vcpu-ubuntu-2404' || 'ubuntu-latest' }}
|
||||||
arch: amd64
|
arch: amd64
|
||||||
- platform: linux/arm64
|
- platform: linux/arm64
|
||||||
runner: ${{ vars.CI_RUNNER_ARM64 || 'ubuntu-24.04-arm' }}
|
runner: ${{ vars.USE_BLACKSMITH == 'true' && 'blacksmith-32vcpu-ubuntu-2404-arm' || 'ubuntu-24.04-arm' }}
|
||||||
arch: arm64
|
arch: arm64
|
||||||
|
|
||||||
runs-on: ${{ matrix.runner }}
|
runs-on: ${{ matrix.runner }}
|
||||||
@@ -78,11 +78,24 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Repository
|
- name: Checkout Repository
|
||||||
|
if: ${{ vars.USE_BLACKSMITH != 'true' }}
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
|
- name: Checkout Repository (Blacksmith)
|
||||||
|
if: ${{ vars.USE_BLACKSMITH == 'true' }}
|
||||||
|
uses: useblacksmith/checkout@v1
|
||||||
|
|
||||||
- name: Setup Docker Buildx
|
- name: Setup Docker Buildx
|
||||||
|
if: ${{ vars.USE_BLACKSMITH != 'true' }}
|
||||||
uses: docker/setup-buildx-action@v4
|
uses: docker/setup-buildx-action@v4
|
||||||
|
|
||||||
|
# Persists BuildKit layers and the Dockerfile's pnpm cache mounts between runs, one cache per architecture.
|
||||||
|
- name: Setup Docker Builder (Blacksmith)
|
||||||
|
if: ${{ vars.USE_BLACKSMITH == 'true' }}
|
||||||
|
uses: useblacksmith/setup-docker-builder@v2
|
||||||
|
with:
|
||||||
|
cache-key: Dockerfile-${{ matrix.arch }}
|
||||||
|
|
||||||
- ®istries
|
- ®istries
|
||||||
name: Determine registries
|
name: Determine registries
|
||||||
id: registries
|
id: registries
|
||||||
@@ -133,17 +146,23 @@ jobs:
|
|||||||
type=sha,prefix=sha-,suffix=-${{ matrix.arch }}
|
type=sha,prefix=sha-,suffix=-${{ matrix.arch }}
|
||||||
|
|
||||||
- name: Cache-only smoke build
|
- name: Cache-only smoke build
|
||||||
if: ${{ needs.mode.outputs.canary == 'true' }}
|
if: ${{ needs.mode.outputs.canary == 'true' && vars.USE_BLACKSMITH != 'true' }}
|
||||||
uses: docker/build-push-action@v7
|
uses: docker/build-push-action@v7
|
||||||
with:
|
with: &cache-only-build
|
||||||
context: .
|
context: .
|
||||||
platforms: ${{ matrix.platform }}
|
platforms: ${{ matrix.platform }}
|
||||||
outputs: type=cacheonly
|
outputs: type=cacheonly
|
||||||
|
|
||||||
|
- name: Cache-only smoke build (Blacksmith)
|
||||||
|
if: ${{ needs.mode.outputs.canary == 'true' && vars.USE_BLACKSMITH == 'true' }}
|
||||||
|
uses: useblacksmith/build-push-action@v2
|
||||||
|
with: *cache-only-build
|
||||||
|
|
||||||
- name: Build and Push by Digest
|
- name: Build and Push by Digest
|
||||||
id: build
|
id: build
|
||||||
|
if: ${{ vars.USE_BLACKSMITH != 'true' }}
|
||||||
uses: docker/build-push-action@v7
|
uses: docker/build-push-action@v7
|
||||||
with:
|
with: &build-push
|
||||||
context: .
|
context: .
|
||||||
sbom: true
|
sbom: true
|
||||||
push: true
|
push: true
|
||||||
@@ -153,10 +172,16 @@ jobs:
|
|||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
annotations: ${{ steps.meta.outputs.annotations }}
|
annotations: ${{ steps.meta.outputs.annotations }}
|
||||||
|
|
||||||
|
- name: Build and Push by Digest (Blacksmith)
|
||||||
|
id: build-blacksmith
|
||||||
|
if: ${{ vars.USE_BLACKSMITH == 'true' }}
|
||||||
|
uses: useblacksmith/build-push-action@v2
|
||||||
|
with: *build-push
|
||||||
|
|
||||||
- name: Export digest
|
- name: Export digest
|
||||||
run: |
|
run: |
|
||||||
mkdir -p /tmp/digests
|
mkdir -p /tmp/digests
|
||||||
digest="${{ steps.build.outputs.digest }}"
|
digest="${{ steps.build.outputs.digest || steps.build-blacksmith.outputs.digest }}"
|
||||||
touch "/tmp/digests/${digest#sha256:}"
|
touch "/tmp/digests/${digest#sha256:}"
|
||||||
|
|
||||||
- name: Upload digest
|
- name: Upload digest
|
||||||
@@ -172,7 +197,7 @@ jobs:
|
|||||||
- mode
|
- mode
|
||||||
- build
|
- build
|
||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
runs-on: ${{ vars.CI_RUNNER_X64 || 'ubuntu-latest' }}
|
runs-on: ${{ vars.USE_BLACKSMITH == 'true' && 'blacksmith-2vcpu-ubuntu-2404' || 'ubuntu-latest' }}
|
||||||
|
|
||||||
env:
|
env:
|
||||||
DEPLOY: ${{ secrets.SSH_KEY != '' && secrets.SSH_HOST != '' && secrets.SSH_USER != '' }}
|
DEPLOY: ${{ secrets.SSH_KEY != '' && secrets.SSH_HOST != '' && secrets.SSH_USER != '' }}
|
||||||
@@ -186,11 +211,17 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Repository
|
- name: Checkout Repository
|
||||||
|
if: ${{ vars.USE_BLACKSMITH != 'true' }}
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v6
|
||||||
with:
|
with: &checkout-package-json
|
||||||
sparse-checkout: package.json
|
sparse-checkout: package.json
|
||||||
sparse-checkout-cone-mode: false
|
sparse-checkout-cone-mode: false
|
||||||
|
|
||||||
|
- name: Checkout Repository (Blacksmith)
|
||||||
|
if: ${{ vars.USE_BLACKSMITH == 'true' }}
|
||||||
|
uses: useblacksmith/checkout@v1
|
||||||
|
with: *checkout-package-json
|
||||||
|
|
||||||
- name: Get version from package.json
|
- name: Get version from package.json
|
||||||
id: version
|
id: version
|
||||||
run: echo "version=$(jq -r .version package.json)" >> "$GITHUB_OUTPUT"
|
run: echo "version=$(jq -r .version package.json)" >> "$GITHUB_OUTPUT"
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ env:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
e2e:
|
e2e:
|
||||||
runs-on: ${{ vars.CI_RUNNER_X64 || 'ubuntu-latest' }}
|
runs-on: ${{ vars.USE_BLACKSMITH == 'true' && 'blacksmith-32vcpu-ubuntu-2404' || 'ubuntu-latest' }}
|
||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
|
|
||||||
services:
|
services:
|
||||||
@@ -40,10 +40,17 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Repository
|
- name: Checkout Repository
|
||||||
|
if: ${{ vars.USE_BLACKSMITH != 'true' }}
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
|
|
||||||
|
- name: Checkout Repository (Blacksmith)
|
||||||
|
if: ${{ vars.USE_BLACKSMITH == 'true' }}
|
||||||
|
uses: useblacksmith/checkout@v1
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
- name: Install pnpm
|
- name: Install pnpm
|
||||||
uses: pnpm/action-setup@v6
|
uses: pnpm/action-setup@v6
|
||||||
|
|
||||||
|
|||||||
@@ -10,14 +10,21 @@ permissions:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
label:
|
label:
|
||||||
runs-on: ${{ vars.CI_RUNNER_X64 || 'ubuntu-latest' }}
|
runs-on: ${{ vars.USE_BLACKSMITH == 'true' && 'blacksmith-2vcpu-ubuntu-2404' || 'ubuntu-latest' }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Repository
|
- name: Checkout Repository
|
||||||
|
if: ${{ vars.USE_BLACKSMITH != 'true' }}
|
||||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
|
||||||
with:
|
with:
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
|
|
||||||
|
- name: Checkout Repository (Blacksmith)
|
||||||
|
if: ${{ vars.USE_BLACKSMITH == 'true' }}
|
||||||
|
uses: useblacksmith/checkout@v1
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
- name: Apply Form Labels
|
- name: Apply Form Labels
|
||||||
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
|
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
|
||||||
with:
|
with:
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ permissions:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
stale:
|
stale:
|
||||||
runs-on: ${{ vars.CI_RUNNER_X64 || 'ubuntu-latest' }}
|
runs-on: ${{ vars.USE_BLACKSMITH == 'true' && 'blacksmith-2vcpu-ubuntu-2404' || 'ubuntu-latest' }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Close Inactive Issues Awaiting Information
|
- name: Close Inactive Issues Awaiting Information
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ env:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
artifact:
|
artifact:
|
||||||
runs-on: ${{ vars.CI_RUNNER_X64 || 'ubuntu-latest' }}
|
runs-on: ${{ vars.USE_BLACKSMITH == 'true' && 'blacksmith-32vcpu-ubuntu-2404' || 'ubuntu-latest' }}
|
||||||
timeout-minutes: 20
|
timeout-minutes: 20
|
||||||
services:
|
services:
|
||||||
postgres:
|
postgres:
|
||||||
@@ -36,7 +36,12 @@ jobs:
|
|||||||
VERCEL: "1"
|
VERCEL: "1"
|
||||||
VERCEL_ENV: production
|
VERCEL_ENV: production
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- if: ${{ vars.USE_BLACKSMITH != 'true' }}
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- if: ${{ vars.USE_BLACKSMITH == 'true' }}
|
||||||
|
uses: useblacksmith/checkout@v1
|
||||||
with:
|
with:
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
- uses: pnpm/action-setup@v6
|
- uses: pnpm/action-setup@v6
|
||||||
@@ -81,11 +86,16 @@ jobs:
|
|||||||
|
|
||||||
live-smoke:
|
live-smoke:
|
||||||
if: github.event_name == 'workflow_dispatch'
|
if: github.event_name == 'workflow_dispatch'
|
||||||
runs-on: ${{ vars.CI_RUNNER_X64 || 'ubuntu-latest' }}
|
runs-on: ${{ vars.USE_BLACKSMITH == 'true' && 'blacksmith-2vcpu-ubuntu-2404' || 'ubuntu-latest' }}
|
||||||
environment: vercel-smoke
|
environment: vercel-smoke
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- if: ${{ vars.USE_BLACKSMITH != 'true' }}
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- if: ${{ vars.USE_BLACKSMITH == 'true' }}
|
||||||
|
uses: useblacksmith/checkout@v1
|
||||||
with:
|
with:
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
- uses: actions/setup-node@v6
|
- uses: actions/setup-node@v6
|
||||||
|
|||||||
@@ -7,10 +7,17 @@ The repository is `reactive-resume/reactive-resume`. Docker Hub remains
|
|||||||
## Builds and release safety
|
## Builds and release safety
|
||||||
|
|
||||||
`.github/workflows/docker-build.yml` builds AMD64 and ARM64 on matching native runners.
|
`.github/workflows/docker-build.yml` builds AMD64 and ARM64 on matching native runners.
|
||||||
Repository variables `CI_RUNNER_X64` and `CI_RUNNER_ARM64` select the runner labels;
|
All workflows run on GitHub-hosted runners (`ubuntu-latest`, `ubuntu-24.04-arm`) by default,
|
||||||
they default to `ubuntu-latest` and `ubuntu-24.04-arm`, respectively. Other CI workflows
|
so forks work without setup. Setting the repository variable `USE_BLACKSMITH=true` switches
|
||||||
also use `CI_RUNNER_X64`. Docker Buildx shares its local cache between steps within a job;
|
every job to Blacksmith runners (32 vCPU for build/test jobs, 2 vCPU for lightweight jobs) and
|
||||||
no cache is persisted between workflow runs.
|
swaps in `useblacksmith/checkout`, `useblacksmith/setup-docker-builder`, and
|
||||||
|
`useblacksmith/build-push-action`. Because `uses:` cannot be an expression, each swapped
|
||||||
|
action is a pair of steps gated on the variable; keep both halves in sync when editing.
|
||||||
|
|
||||||
|
On GitHub-hosted runners, Docker Buildx shares its local cache between steps within a job and
|
||||||
|
no cache is persisted between workflow runs. On Blacksmith, the builder persists layers and the
|
||||||
|
Dockerfile's pnpm cache mounts between runs, keyed per architecture (`Dockerfile-amd64`,
|
||||||
|
`Dockerfile-arm64`).
|
||||||
|
|
||||||
| Trigger | Published aliases | Production deployment |
|
| Trigger | Published aliases | Production deployment |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
|
|||||||
Reference in New Issue
Block a user