ci: configure deployment to GitHub Pages #3
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: Pipeline | |
on: | |
push: | |
branches: ["main"] | |
workflow_dispatch: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
cache: "pnpm" | |
- name: Install dependencies | |
run: | | |
corepack enable | |
corepack install | |
pnpm install --frozen-lockfile | |
- name: Test | |
run: pnpm test | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
cache: "pnpm" | |
- name: Install dependencies | |
run: | | |
corepack enable | |
corepack install | |
pnpm install --frozen-lockfile | |
- name: Build | |
run: pnpm build | |
- name: Setup GitHub Pages | |
uses: actions/configure-pages@v5 | |
- name: Upload | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: ./dist | |
deploy: | |
runs-on: ubuntu-latest | |
needs: | |
- test | |
- build | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |