Skip to content

Commit fab5285

Browse files
TMHSDigitalclaude
andcommitted
Workflows: build once per push, never cancel a live deploy, job timeouts
pages.yml now calls ci.yml with upload-dist, which checks out full history, runs tests, validate and the page-checking build, and uploads site/dist as the Pages artifact; the separate build job is gone and ci.yml no longer runs on push to main, so a push builds the site once instead of three times. cancel-in-progress is off for the pages group. Every job has a timeout-minutes (part of #134). Closes #136 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
1 parent 2230435 commit fab5285

5 files changed

Lines changed: 31 additions & 28 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,32 @@ name: Validate catalog
22

33
# No path filters: the build reads catalog/, stacks/, docs/, site/ and the
44
# top-level Markdown files, and the whole run takes seconds.
5+
#
6+
# Runs on pull requests, and as the first job of pages.yml on every push to
7+
# main (so a push builds once, not three times). With `upload-dist` the
8+
# checkout has full history (the sitemap's lastmod dates come from git) and
9+
# the built site is uploaded as the Pages artifact for pages.yml to deploy.
510
on:
611
pull_request:
7-
push:
8-
branches: [main]
912
workflow_call:
13+
inputs:
14+
upload-dist:
15+
description: Build with full git history and upload site/dist as the Pages artifact
16+
type: boolean
17+
default: false
1018

1119
permissions:
1220
contents: read
1321

1422
jobs:
1523
validate:
1624
runs-on: ubuntu-latest
25+
timeout-minutes: 10
1726
steps:
1827
- name: Checkout
1928
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
29+
with:
30+
fetch-depth: ${{ inputs.upload-dist && '0' || '1' }}
2031

2132
- name: Setup Node
2233
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
@@ -32,3 +43,9 @@ jobs:
3243
run: node site/validate.mjs
3344
- name: Build site and check pages
3445
run: node site/build.mjs
46+
47+
- name: Upload Pages artifact
48+
if: ${{ inputs.upload-dist }}
49+
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
50+
with:
51+
path: site/dist

‎.github/workflows/links.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ permissions:
1515
jobs:
1616
links:
1717
runs-on: ubuntu-latest
18+
timeout-minutes: 30
1819
steps:
1920
- name: Checkout
2021
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

‎.github/workflows/pages.yml‎

Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -14,41 +14,24 @@ permissions:
1414
pages: write
1515
id-token: write
1616

17+
# One deploy at a time. A run in progress finishes; the next one queues
18+
# behind it rather than cancelling a production deploy halfway.
1719
concurrency:
1820
group: pages
19-
cancel-in-progress: true
21+
cancel-in-progress: false
2022

2123
jobs:
22-
# The same tests, validation and page checks as a pull request runs.
23-
validate:
24-
uses: ./.github/workflows/ci.yml
25-
24+
# The same tests, validation and page checks as a pull request runs, with
25+
# full git history, and the built site uploaded as the Pages artifact.
2626
build:
27-
needs: validate
28-
runs-on: ubuntu-latest
29-
steps:
30-
- name: Checkout
31-
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
32-
with:
33-
# The sitemap's lastmod dates come from git history.
34-
fetch-depth: 0
35-
36-
- name: Setup Node
37-
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
38-
with:
39-
node-version-file: .nvmrc
40-
41-
- name: Build site
42-
run: node site/build.mjs
43-
44-
- name: Upload Pages artifact
45-
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
46-
with:
47-
path: site/dist
27+
uses: ./.github/workflows/ci.yml
28+
with:
29+
upload-dist: true
4830

4931
deploy:
5032
needs: build
5133
runs-on: ubuntu-latest
34+
timeout-minutes: 10
5235
environment:
5336
name: github-pages
5437
url: ${{ steps.deployment.outputs.page_url }}

‎.github/workflows/reverify.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ permissions:
1616
jobs:
1717
reverify:
1818
runs-on: ubuntu-latest
19+
timeout-minutes: 10
1920
steps:
2021
- name: Checkout
2122
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

‎.github/workflows/thumbs.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ permissions:
1818
jobs:
1919
thumbs:
2020
runs-on: ubuntu-latest
21+
timeout-minutes: 30
2122
steps:
2223
- name: Checkout
2324
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

0 commit comments

Comments
 (0)