From 70bbe1b05289a6d704c1a2d3b1c3310f2a477a24 Mon Sep 17 00:00:00 2001 From: rrrro Date: Sat, 28 Dec 2024 22:53:16 +0800 Subject: [PATCH] chore: add deploy workflow --- .cspell-dict.txt | 1 + .cspell-ignore.txt | 1 + .github/workflows/deploy-github-pages.yml | 40 +++++++++++++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 .github/workflows/deploy-github-pages.yml diff --git a/.cspell-dict.txt b/.cspell-dict.txt index b459fce..660066b 100644 --- a/.cspell-dict.txt +++ b/.cspell-dict.txt @@ -1,4 +1,5 @@ changefreq +github hideable lastmod lidao diff --git a/.cspell-ignore.txt b/.cspell-ignore.txt index 2d7d453..0bb6cd5 100644 --- a/.cspell-ignore.txt +++ b/.cspell-ignore.txt @@ -1,2 +1,3 @@ dracula easyops +peaceiris diff --git a/.github/workflows/deploy-github-pages.yml b/.github/workflows/deploy-github-pages.yml new file mode 100644 index 0000000..14926de --- /dev/null +++ b/.github/workflows/deploy-github-pages.yml @@ -0,0 +1,40 @@ +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow + +name: Deploy to GitHub Pages + +on: + push: + branches: + - main + workflow_dispatch: + +permissions: + contents: write + pages: write + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: true + lfs: true + + - uses: oven-sh/setup-bun@v2 + with: + bun-version: latest + + - name: Install dependencies + run: bun install + + - name: Build + run: bun build + + - name: Deploy + uses: peaceiris/actions-gh-pages@v4 + if: github.ref == 'refs/heads/main' + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./build # default: public