Update SW (#40) #18
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Pages" | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- src/** | |
repository_dispatch: | |
types: | |
- webhook | |
workflow_dispatch: | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
jobs: | |
build: | |
name: "Build" | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- name: "Checkout" | |
uses: actions/checkout@v4 | |
- name: "Setup Node" | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: "Install Dependencies" | |
run: | | |
npm install | |
- name: "Update Cache Version" | |
run: | | |
echo "Updating Cache to Version: v${GITHUB_RUN_NUMBER}" | |
sed -i "0,/v1/s//v${GITHUB_RUN_NUMBER}/" src/sw.js | |
head src/sw.js -n 4 | |
- name: "Configure Pages" | |
uses: actions/configure-pages@v5 | |
- name: "Jekyll Build Pages" | |
uses: actions/jekyll-build-pages@v1 | |
with: | |
source: "./src" | |
- name: "Upload Pages Artifact" | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: _site/ | |
deploy: | |
name: "Deploy" | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
needs: build | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- name: "Deploy Pages" | |
id: deployment | |
uses: actions/deploy-pages@v4 | |
with: | |
artifact_name: github-pages |