Skip to content

Commit ee2c6b2

Browse files
alukachclaude
andauthored
ci: publish next only when its code or docs change (#92)
Main previews runs only for pushes that change src/, Cargo.toml, Cargo.lock or the preview pipeline; the Docs workflow's push to next/ uses the same paths as its PR previews. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 97f133a commit ee2c6b2

3 files changed

Lines changed: 14 additions & 4 deletions

File tree

‎.github/workflows/docs.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ on:
1212
types: [published]
1313
push:
1414
branches: [main]
15+
paths: ["README.md", "docs/**", "!docs/recorder/**", ".github/workflows/docs*.yml"]
1516
pull_request:
1617
types: [opened, reopened, synchronize, closed]
1718
paths: ["README.md", "docs/**", "!docs/recorder/**", ".github/workflows/docs*.yml"]

‎.github/workflows/main-previews.yml‎

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
11
name: Main previews
22

3-
# After each push to main, publishes it as the `next` preview (see Preview
4-
# build): source-coop-next with production's defaults, the next release, and
5-
# source-coop-next-staging calling source.coop's staging environment.
3+
# After each push to main that changes what's built, publishes it as the
4+
# `next` preview (see Preview build): source-coop-next with production's
5+
# defaults, the next release, and source-coop-next-staging calling
6+
# source.coop's staging environment. A push that changes only docs or CI
7+
# elsewhere leaves the last one in place.
68
on:
79
push:
810
branches: [main]
11+
paths:
12+
- "src/**"
13+
- "Cargo.toml"
14+
- "Cargo.lock"
15+
- ".github/preview/install.sh"
16+
- ".github/workflows/main-previews.yml"
17+
- ".github/workflows/preview-build.yml"
918

1019
permissions:
1120
contents: write

‎CONTRIBUTING.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ curl -LsSf https://github.com/source-cooperative/source-coop-cli/releases/downlo
2727

2828
Running it again updates the preview. For a `both` preview, that line installs the production build; add `-s -- staging` after `sh` for the staging one.
2929

30-
**Every push to main is published as the `next` preview** (the *Main previews* workflow): `source-coop-next` is the next release as it stands, and `source-coop-next-staging` is the same commit calling staging. Its docs go to <https://source-cooperative.github.io/source-coop-cli/next/>, listed as `next` in the version menu; `latest/` stays the newest release.
30+
**Every push to main that changes the code (`src/`, `Cargo.toml`, `Cargo.lock`) is published as the `next` preview** (the *Main previews* workflow): `source-coop-next` is the next release as it stands, and `source-coop-next-staging` is the same commit calling staging. Its docs go to <https://source-cooperative.github.io/source-coop-cli/next/> when the README or `docs/` changes, listed as `next` in the version menu; `latest/` stays the newest release.
3131

3232
```bash
3333
curl -LsSf https://github.com/source-cooperative/source-coop-cli/releases/download/next/install.sh | sh # source-coop-next

0 commit comments

Comments
 (0)