[website] Write github actions script for website deployment #1
This file contains hidden or 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: Deploy on Github Pages | |
on: | |
push: | |
branches: ["main"] | |
permissions: | |
pages: write | |
id-token: write | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./website | |
steps: | |
- name: Checkout Source | |
uses: actions/checkout@v4 | |
with: | |
submodules: "recursive" | |
- name: Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Install Dependencies | |
run: npm install | |
- name: Build Vite | |
run: npm run build | |
- name: Upload artifacts | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
name: "github-pages" | |
path: website/dist | |
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 |