修改 pwa 缓存配置 #332
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: Build test page to GitHub Pages | |
on: | |
push: | |
branches: [ "master" ] | |
workflow_dispatch: | |
inputs: | |
tags: | |
description: 'Run workflow manually' | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
jobs: | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [16.x] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Setup Pages | |
uses: actions/configure-pages@v2 | |
- name: Build webpack | |
run: | | |
npm install | |
npm run build | |
- name: Upload sourcemap to Sentry | |
uses: getsentry/action-release@v1 | |
env: | |
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
SENTRY_ORG: ${{ secrets.SENTRY_ORG }} | |
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }} | |
with: | |
environment: production | |
version: ${{ github.sha }} | |
sourcemaps: './dist ./dist/assets' | |
set_commits: skip | |
ignore_missing: true | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
path: './dist' | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v1 |