fix: set correct basepath #7
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, Check, 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 | |
- name: Check | |
run: pnpm check | |
- name: Lint | |
run: pnpm lint | |
- name: Archive artifact | |
shell: sh | |
if: runner.os == 'Linux' | |
run: | | |
chmod -c -R +rX "build/" | while read line; do | |
echo "::warning title=Invalid file permissions automatically fixed::$line" | |
done | |
tar \ | |
--dereference --hard-dereference \ | |
--directory "build/" \ | |
-cvf "$RUNNER_TEMP/artifact.tar" \ | |
--exclude=.git \ | |
--exclude=.github \ | |
. | |
- name: Upload artifact | |
uses: actions/upload-artifact@main | |
with: | |
name: github-pages | |
path: ${{ runner.temp }}/artifact.tar | |
retention-days: 30 | |
deploy-demo: | |
name: Deploy app | |
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@v1 |