-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (69 loc) · 2.02 KB
/
deploy.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# https://github.com/actions/deploy-pages#usage
name: Deploy to GitHub Pages
on:
workflow_run:
workflows:
- Sync
types:
- completed
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: deploy
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Cache Black Hole
uses: actions/cache/restore@v4
with:
path: node_modules
key: blackhole
# Pick your own package manager and build script
- run: bun install --locked
- name: Save Black Hole
uses: actions/cache/save@v4
with:
path: node_modules
key: blackhole
- run: bun run build --preset github_pages
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: build-output
path: ./.output/public
# Deployment job
deploy:
# Add a dependency to the build job
needs: build
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
contents: write # to deploy to gh_pages branch
# pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
# Deploy to the github_pages environment
environment:
name: github_pages
url: ${{ steps.deployment.outputs.page_url }}
# Specify runner + deployment step
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: build-output
path: dist
- name: Deploy to gh_pages branch
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: dist
publish_branch: gh_pages
# https://github.com/peaceiris/actions-gh-pages/issues/163
exclude_assets: ''
force_orphan: true
commit_message: 'deploy'