This commit is contained in:
parent
a4ee2a9fe4
commit
0a49531a71
34 changed files with 6941 additions and 2 deletions
49
.github/workflows/update.yml
vendored
Normal file
49
.github/workflows/update.yml
vendored
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
name: Deploy to GitHub Pages
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
name: Deploy to GitHub Pages
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Bun
|
||||
uses: oven-sh/setup-bun@v1
|
||||
with:
|
||||
bun-version: latest
|
||||
|
||||
- name: Install dependencies
|
||||
run: bun install --frozen-lockfile
|
||||
|
||||
- name: Build project
|
||||
run: bun --bun run build
|
||||
|
||||
- name: Ensure deploy branch exists
|
||||
run: |
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||
if ! git ls-remote --exit-code --heads origin gh-pages; then
|
||||
git checkout --orphan gh-pages
|
||||
git rm -rf .
|
||||
git commit --allow-empty -m "Initialize gh-pages branch"
|
||||
git push origin gh-pages
|
||||
git checkout main
|
||||
fi
|
||||
|
||||
- name: Deploy to extra branch
|
||||
uses: peaceiris/actions-gh-pages@v4
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
publish_dir: ./dist
|
||||
publish_branch: gh-pages
|
||||
Loading…
Reference in a new issue