chore: bump version #14
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" | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
name: Build, Test, Lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 'latest' | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
with: | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: pnpm install | |
- name: Build | |
run: pnpm build --configuration=production | |
- name: Test | |
run: pnpm test | |
- name: Lint | |
run: pnpm lint | |
- name: SPA 404 workaround | |
shell: sh | |
if: runner.os == 'Linux' | |
run: | | |
cp dist/demo/browser/index.html dist/demo/browser/404.html | |
- name: Archive artifact | |
shell: sh | |
if: runner.os == 'Linux' | |
run: | | |
chmod -c -R +rX "dist/demo/browser" | while read line; do | |
echo "::warning title=Invalid file permissions automatically fixed::$line" | |
done | |
tar \ | |
--dereference --hard-dereference \ | |
--directory "dist/demo/browser" \ | |
-cvf "$RUNNER_TEMP/artifact.tar" \ | |
--exclude=.git \ | |
--exclude=.github \ | |
. | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: github-pages | |
path: ${{ runner.temp }}/artifact.tar | |
retention-days: 30 | |
deploy-demo: | |
name: Deploy demo | |
runs-on: ubuntu-latest | |
needs: build | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- name: Deploy demo to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |