1name: deploy website
2on:
3 push:
4 branches:
5 - main
6 workflow_dispatch:
7
8jobs:
9 build:
10 runs-on: ubuntu-latest
11 steps:
12 - uses: actions/checkout@v3
13 - uses: oven-sh/setup-bun@v2
14 with:
15 bun-version: latest
16
17 - name: restore cached node modules
18 uses: actions/cache/restore@v4
19 id: cache-node-modules
20 with:
21 path: node_modules
22 key: ${{ runner.os }}-node-${{ hashFiles('**/bun.lockb') }}
23
24 - name: install dependencies
25 if: steps.cache-node-modules.outputs.cache-hit != 'true'
26 run: bun install
27
28 - name: build
29 run: bun run build
30
31 - name: upload statics as artifact
32 id: deployment
33 uses: actions/upload-pages-artifact@v3
34 with:
35 path: dist/
36
37 deploy:
38 needs: build
39 runs-on: ubuntu-latest
40
41 permissions:
42 pages: write
43 id-token: write
44
45 environment:
46 name: github-pages
47 url: ${{ steps.deployment.outputs.page_url }}
48
49 steps:
50 - name: deploy to pages
51 id: deployment
52 uses: actions/deploy-pages@v4