Deployment to GitHub Pages #69
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: Deployment to GitHub Pages | |
permissions: | |
contents: write | |
on: | |
# call this workflow when the workflow Main Validation is completed after a push to main | |
workflow_run: | |
workflows: | |
- 'Lint Code Base' | |
- 'Typecheck' | |
branches: | |
- main | |
types: | |
- completed | |
jobs: | |
deploy: | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
runs-on: ubuntu-latest | |
concurrency: nameyourpc-deployment | |
steps: | |
- name: Begin CI... | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: .node-version | |
- uses: pnpm/action-setup@v2 | |
name: Install pnpm | |
with: | |
version: 8 | |
run_install: true | |
- name: Install dependencies | |
run: pnpm install | |
- name: Build page | |
run: npm run build | |
env: | |
VITE_APP_BASE_URL: /nameyourpc/ | |
- name: Deploy to gh-pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./dist |