Skip to content

Build and Deploy

Build and Deploy #5

Workflow file for this run

name: "Build and Deploy"
on:
workflow_dispatch:
push:
branches:
- main
- master
paths-ignore:
- .gitignore
- README.md
- LICENSE
permissions:
contents: read
pages: write
id-token: write
# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 3
strategy:
matrix:
node-version: [20]
steps:
- name: "☁️ Checkout repository"
uses: actions/checkout@v4
- name: "📦 Install pnpm"
uses: pnpm/action-setup@v4
with:
version: 10.11.1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"
- name: "📦 Install dependencies"
run: pnpm install
- name: "🔎 Lint code"
run: pnpm run lint
- name: "📝 Checking code format"
run: pnpm run format:check
- name: "🚀 Build the project"
run: pnpm run build
- name: "Copy to base path"
run: cp -r dist _site${{ steps.pages.outputs.base_path }}
- name: Upload site artifact
uses: actions/upload-pages-artifact@v3
with:
path: "_site${{ steps.pages.outputs.base_path }}"
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4