Skip to content

Commit

Permalink
Build pages on PRs but dont publish (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
jesserockz authored Nov 18, 2024
1 parent 71d36f6 commit d26dec0
Showing 1 changed file with 22 additions and 8 deletions.
30 changes: 22 additions & 8 deletions .github/workflows/publish-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,32 @@ on:
- main
paths:
- 'static/**'
- '.github/workflows/publish-pages.yml'
workflow_run:
workflows:
- Publish Firmware
types:
- completed
pull_request:
paths:
- 'static/**'
- '.github/workflows/publish-pages.yml'


concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build-and-publish:
name: Build and publish site
build:
name: Build
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Checkout source code
uses: actions/checkout@v4.2.2

- run: mkdir -p output/firmware

- name: Build
uses: actions/jekyll-build-pages@v1.0.13
with:
Expand All @@ -50,6 +51,19 @@ jobs:
path: output
retention-days: 1

publish:
if: github.event_name != 'pull_request'
name: Publish
runs-on: ubuntu-latest
needs:
- build
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Setup Pages
uses: actions/configure-pages@v5.0.0

Expand Down

0 comments on commit d26dec0

Please sign in to comment.