mirror of
https://github.com/SukkaW/Surge.git
synced 2025-12-12 09:10:35 +08:00
45 lines
1.2 KiB
YAML
45 lines
1.2 KiB
YAML
name: Build
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
schedule:
|
|
- cron: '0 12 * * *'
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
persist-credentials: false
|
|
- uses: oven-sh/setup-bun@v1
|
|
with:
|
|
bun-version: canary
|
|
- name: Get current date
|
|
id: date
|
|
run: echo "date=$(date +'%Y-%m-%d %H:%M:%S')" >> $GITHUB_OUTPUT
|
|
- name: Cache cache.db
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: |
|
|
.cache
|
|
key: ${{ runner.os }}-v1-${{ steps.date.outputs.date }}
|
|
# If source files changed but packages didn't, rebuild from a prior cache.
|
|
restore-keys: |
|
|
${{ runner.os }}-v1
|
|
- run: bun install
|
|
- run: bun run build
|
|
- name: Deploy
|
|
uses: peaceiris/actions-gh-pages@v3
|
|
with:
|
|
personal_token: ${{ secrets.GIT_TOKEN }}
|
|
user_name: ${{ secrets.GIT_USER }}
|
|
user_email: ${{ secrets.GIT_EMAIL }}
|
|
external_repository: SukkaLab/ruleset.skk.moe
|
|
publish_branch: master
|
|
publish_dir: public
|
|
cname: ruleset.skk.moe
|