Skip to content

Commit 77987c8

Browse files
authored
feat: add github action to deploy to pages (#3)
* feat: add github action to deploy to pages * setup pnpm * remove version * fix things * move dist to docs * use checkout action * fix lint * only run on pushes to main
1 parent 5e82a9e commit 77987c8

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

.github/workflows/pages.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: GitHub Pages
2+
on:
3+
push:
4+
branches:
5+
- main
6+
permissions:
7+
contents: write
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
- uses: pnpm/action-setup@v4
14+
- name: Install dependencies
15+
run: pnpm i
16+
- name: Build application
17+
run: pnpm build
18+
- name: Remove all files except dist directory
19+
run: find . -maxdepth 1 ! -name 'dist' ! -name '.git' ! -name '.' -exec rm -rf {} +
20+
- name: Move dist to docs
21+
run: mv dist docs
22+
- uses: actions/checkout@v3
23+
with:
24+
ref: 'gh-pages'
25+
clean: false
26+
- name: Push to gh-pages
27+
run: |
28+
git config user.name "github-actions[bot]"
29+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
30+
git add .
31+
git commit -m "Release project"
32+
git push

0 commit comments

Comments
 (0)