-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (32 loc) · 1.06 KB
/
deploy_to_github_pages.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Deploy Static Website to GitHub Pages
on:
push:
branches: [master] # Changed from 'main' to 'master' to match your repository
permissions:
contents: write # This line gives the workflow permission to write to your repository
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20.11"
- name: Install pnpm
run: npm install -g pnpm
- name: Install dependencies
run: pnpm install
- name: Remove vite.svg
run: rm ./public/vite.svg
- name: Build
run: pnpm run build.ghpages
- name: Deploy to GitHub Pages
run: |
git config --global user.name 'GitHub Actions'
git config --global user.email '[email protected]'
git checkout --orphan gh-pages
git --work-tree dist add --all
git commit -m "Deploy to GitHub Pages"
git push origin gh-pages --force