Skip to content

Commit

Permalink
Add gh-pages action
Browse files Browse the repository at this point in the history
Signed-off-by: Jay Wang <[email protected]>
  • Loading branch information
xiaohk committed Nov 27, 2023
1 parent 7ff984e commit 9370cca
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
matrix:
node-version: [16]
os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v3
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Deploy GitHub Pages

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
deploy:
runs-on: ubuntu-22.04
strategy:
matrix:
node-version: [16]
os: [ubuntu-latest]
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: npm install

- name: Build
run: npm run build:github

- name: Deploy with gh-pages
run: |
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
npx gh-pages -u "github-actions-bot <[email protected]>" -m \"Deploy $(git log '--format=format:%H' main -1)\" -d ./gh-page"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 9370cca

Please sign in to comment.