Skip to content

Commit bc9b239

Browse files
authored
Streamline Pages workflows and add PR build guard (#129)
* Initial plan * chore: improve deployment workflows --------- Co-authored-by: openai-code-agent[bot] <242516109+Codex@users.noreply.github.com>
1 parent 156d5e9 commit bc9b239

2 files changed

Lines changed: 48 additions & 5 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ name: Deploy David KRK Site
33
on:
44
push:
55
branches: [gh-pages]
6+
pull_request:
7+
branches: [gh-pages]
68
workflow_dispatch:
79

810
permissions:
911
contents: read
10-
pages: write
11-
id-token: write
1212

1313
concurrency:
1414
group: "pages"
@@ -17,6 +17,8 @@ concurrency:
1717
jobs:
1818
build:
1919
runs-on: ubuntu-latest
20+
permissions:
21+
contents: read
2022
steps:
2123
- name: Checkout
2224
uses: actions/checkout@v4
@@ -34,14 +36,25 @@ jobs:
3436
run: npm run build
3537

3638
- name: Setup Pages
39+
if: github.event_name == 'push'
3740
uses: actions/configure-pages@v4
3841

42+
- name: Remove node_modules before upload
43+
if: github.event_name == 'push'
44+
run: rm -rf node_modules
45+
3946
- name: Upload artifact
47+
if: github.event_name == 'push'
4048
uses: actions/upload-pages-artifact@v3
4149
with:
4250
path: '.'
4351

4452
deploy:
53+
if: github.event_name == 'push'
54+
permissions:
55+
contents: read
56+
pages: write
57+
id-token: write
4558
environment:
4659
name: github-pages
4760
url: ${{ steps.deployment.outputs.page_url }}
@@ -50,4 +63,4 @@ jobs:
5063
steps:
5164
- name: Deploy to GitHub Pages
5265
id: deployment
53-
uses: actions/deploy-pages@v4
66+
uses: actions/deploy-pages@v4

.github/workflows/jekyll.yml

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,32 @@
1-
# Workflow désactivé temporairement pour éviter les conflits avec deploy.yml
2-
# Le workflow deploy.yml gère maintenant tous les déploiements sur gh-pages
1+
name: Site Build Check (no deploy)
2+
3+
on:
4+
pull_request:
5+
branches: [gh-pages]
6+
schedule:
7+
- cron: '0 5 * * 1'
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
with:
20+
ref: gh-pages
21+
22+
- name: Setup Node.js
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: '20'
26+
cache: 'npm'
27+
28+
- name: Install dependencies
29+
run: npm ci --prefer-offline --no-audit
30+
31+
- name: Build site assets
32+
run: npm run build

0 commit comments

Comments
 (0)