Skip to content

Commit d26dec0

Browse files
authored
Build pages on PRs but dont publish (#21)
1 parent 71d36f6 commit d26dec0

File tree

1 file changed

+22
-8
lines changed

1 file changed

+22
-8
lines changed

.github/workflows/publish-pages.yml

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,32 @@ on:
66
- main
77
paths:
88
- 'static/**'
9+
- '.github/workflows/publish-pages.yml'
910
workflow_run:
1011
workflows:
1112
- Publish Firmware
1213
types:
1314
- completed
15+
pull_request:
16+
paths:
17+
- 'static/**'
18+
- '.github/workflows/publish-pages.yml'
1419

1520

1621
concurrency:
1722
group: ${{ github.workflow }}-${{ github.ref }}
1823
cancel-in-progress: true
1924

2025
jobs:
21-
build-and-publish:
22-
name: Build and publish site
26+
build:
27+
name: Build
2328
runs-on: ubuntu-latest
24-
permissions:
25-
pages: write
26-
id-token: write
27-
environment:
28-
name: github-pages
29-
url: ${{ steps.deployment.outputs.page_url }}
3029
steps:
3130
- name: Checkout source code
3231
uses: actions/[email protected]
3332

33+
- run: mkdir -p output/firmware
34+
3435
- name: Build
3536
uses: actions/[email protected]
3637
with:
@@ -50,6 +51,19 @@ jobs:
5051
path: output
5152
retention-days: 1
5253

54+
publish:
55+
if: github.event_name != 'pull_request'
56+
name: Publish
57+
runs-on: ubuntu-latest
58+
needs:
59+
- build
60+
permissions:
61+
pages: write
62+
id-token: write
63+
environment:
64+
name: github-pages
65+
url: ${{ steps.deployment.outputs.page_url }}
66+
steps:
5367
- name: Setup Pages
5468
uses: actions/[email protected]
5569

0 commit comments

Comments
 (0)