Skip to content

Commit

Permalink
ci: automatically deploy to GitHub Pages (#59)
Browse files Browse the repository at this point in the history
* ci: automatically deploy to gh pages

* fix: build script

* fix: disable build on prs

* test gh action

testing: #59

* action should be only run once

* fomat ci.yml

* use original doc-site vite.config.ts

Co-authored-by: csr632 <632882184@qq.com>
  • Loading branch information
cijiugechu and csr632 committed Jul 5, 2022
1 parent 74d63d7 commit cbae11f
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: ci

on:
push:
branches: [main, test-gh-action]

jobs:
build:
strategy:
matrix:
os: [ubuntu-latest]
node-version: [16.x]

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: pnpm/action-setup@v2.0.1
with:
version: '6'
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Install Dependencies
run: pnpm install

- name: Build
run: pnpm build:docs

- name: Deploy to GitHub Pages
if: success()
uses: crazy-max/ghaction-github-pages@v2
with:
target_branch: gh-pages
build_dir: doc-site/dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"test-serve": "jest",
"test-build": "cross-env VITE_TEST_BUILD=1 jest",
"debug-build": "cross-env VITE_TEST_BUILD=1 VITE_PRESERVE_BUILD_ARTIFACTS=1 jest",
"build:docs": "pnpm --filter doc-site run ssr-for-deploy",
"postinstall": "node ./scripts/linkBins.js"
},
"devDependencies": {
Expand Down

0 comments on commit cbae11f

Please sign in to comment.