diff --git a/.github/workflows/gb-pages.yml b/.github/workflows/gb-pages.yml new file mode 100644 index 00000000..fbe98ecc --- /dev/null +++ b/.github/workflows/gb-pages.yml @@ -0,0 +1,42 @@ +name: GitHub Pages + +on: + push: + branches: + - main + - yuxiang/website + pull_request: + branches: + - main + - release/* + +jobs: + docs-build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup nodejs + uses: actions/setup-node@v2 + with: + node-version: '14' + - name: Test docs build + run: | + cd website + npm ci + npm run build + - name: Prepare ssh key + uses: webfactory/ssh-agent@v0.5.0 + if: ${{ github.event_name == 'push' }} + with: + ssh-private-key: ${{ secrets.GH_PAGES_KEY }} + - name: Publish to GitHub Pages + if: ${{ github.event_name == 'push' }} + env: + GIT_USER: ${{ secrets.GH_PAGES_USERNAME }} + USE_SSH: true + run: | + git config --global user.email "actions@github.com" + git config --global user.name "GitHub Actions" + cd website + npm run deploy