Skip to content

Commit 2ddd9c5

Browse files
Saul-STFCTechassidervoeti
authored
ci: Harden workflows (#925)
* CI: Address zizmor warnings and bump deps * ci: Switch to our own run-prek action * ci: Quote env var in deploy workflow * ci: Change extention from yml to yaml * ci: Add document start to workflows * ci: Unify quotes in workflows * ci: Don't fetch submodules anymore * ci: Add blank lines and step names * ci: Trigger ui/build workflows on workflow changes * fix: correct deploy workflow link and stop build.yaml ignoring itself --------- Co-authored-by: Techassi <git@techassi.dev> Co-authored-by: dervoeti <lukas.krug@stackable.tech>
1 parent c80c4a3 commit 2ddd9c5

8 files changed

Lines changed: 94 additions & 67 deletions

File tree

.github/workflows/build.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
name: Build site
3+
4+
on:
5+
pull_request:
6+
paths-ignore:
7+
- .github/PULL_REQUEST_TEMPLATES/**
8+
- .github/ISSUE_TEMPLATES/**
9+
- scripts/**
10+
11+
permissions: {}
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
permissions:
17+
contents: read
18+
steps:
19+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
20+
with:
21+
fetch-depth: 0
22+
persist-credentials: false
23+
24+
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
25+
with:
26+
node-version: "20"
27+
cache: npm
28+
29+
- name: Install npm dependencies
30+
run: npm ci
31+
32+
- name: Build documentation site
33+
run: make ANTORAFLAGS=--fetch build-local

.github/workflows/build.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: Build and deploy production site
23

34
# This job simply calls a trigger hook in netlify.
@@ -7,14 +8,16 @@ name: Build and deploy production site
78
on:
89
schedule:
910
# Monday to Friday, 2:15 in the night
10-
- cron: '15 2 * * 1-5'
11+
- cron: "15 2 * * 1-5"
1112
workflow_dispatch:
1213

14+
permissions: {}
15+
1316
jobs:
1417
build:
1518
runs-on: ubuntu-latest
1619
steps:
1720
- name: Call Netlify build hook
1821
env:
1922
HOOK_URL: ${{ secrets.NETLIFY_BUILD_TRIGGER_HOOK }}
20-
run: curl -X POST -d '{}' $HOOK_URL
23+
run: curl -X POST -d '{}' "$HOOK_URL"

.github/workflows/pr_pre-commit.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

.github/workflows/pr_prek.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: prek
3+
4+
on:
5+
pull_request:
6+
7+
permissions: {}
8+
9+
jobs:
10+
prek:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
steps:
15+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
16+
with:
17+
fetch-depth: 0
18+
persist-credentials: false
19+
20+
- uses: stackabletech/actions/run-prek@e8aed001d347bcf693e41b61f4098b0cb94b4ab6 # v0.18.0

.github/workflows/ui.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
name: UI lint and bundle
3+
4+
on:
5+
pull_request:
6+
paths:
7+
- ".github/workflows/ui.yaml"
8+
- "ui/**"
9+
- "package-lock.json"
10+
11+
permissions: {}
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
permissions:
17+
contents: read
18+
steps:
19+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
20+
with:
21+
persist-credentials: false
22+
23+
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
24+
with:
25+
node-version: "24"
26+
cache: npm
27+
28+
- name: Install npm dependencies
29+
run: npm ci
30+
31+
- name: Lint the UI project
32+
run: npm run lint --workspace ui
33+
34+
- name: Bundle the UI project
35+
run: npm run bundle --workspace ui

.github/workflows/ui.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

modules/contributor/pages/docs/backporting-changes.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ The documentation uses https://trunkbaseddevelopment.com/[trunk based developmen
1919
That's it, you're done!
2020

2121
The changes will become visible in the online documentation once the next build is triggered.
22-
You can either wait for the nightly build, or trigger a build yourself with the https://github.com/stackabletech/documentation/actions/workflows/deploy.yml[Build and deploy production site{external-link-icon}^] GitHub action.
22+
You can either wait for the nightly build, or trigger a build yourself with the https://github.com/stackabletech/documentation/actions/workflows/deploy.yaml[Build and deploy production site{external-link-icon}^] GitHub action.

0 commit comments

Comments
 (0)