-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (42 loc) · 1.73 KB
/
build-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
42
43
44
45
46
47
48
49
50
51
name: Build and Deploy Static Page
on:
# Trigger on manual run, push to main, or pull request to main
workflow_dispatch: # Manual trigger
push:
branches:
- main # Trigger on push to the main branch
# pull_request:
# branches:
# - main # Trigger on PRs to the main branch
jobs:
build:
name: Build static page
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4 # Checkout code
- uses: oven-sh/setup-bun@v2 # Set up Bun
- run: bun install # Install dependencies
- run: bun run build # Build the static site
# Upload the build output as an artifact for GitHub Pages deployment
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3 # Use the official upload-pages-artifact action
with:
path: ./dist # Path to the build output (adjust this as per your setup)
name: github-pages # Artifact name (must be 'github-pages')
retention-days: 1 # Optional: Artifact retention time, default is 1 day
deploy:
name: Deploy to GitHub Pages
needs: build # Ensure deployment happens after the build job
runs-on: ubuntu-latest
permissions:
pages: write # Required permission for GitHub Pages deployment
id-token: write # Permission to verify the deployment origin
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4 # Use the correct version of the deploy-pages action
with:
token: ${{ secrets.GITHUB_TOKEN }} # GitHub token for authentication