feat: modify #12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# use this action(https://github.com/JamesIves/github-pages-deploy-action) | |
name: page Build and Deploy | |
on: | |
push: | |
branches: | |
- main | |
permissions: | |
contents: write # Workflow permissions. permissions granted to the GITHUB_TOKEN when running workflows in this repository | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout 🛎️ | |
uses: actions/checkout@v3 | |
- name: Set up Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16.x | |
- name: install pnpm | |
run: | | |
npm install -g pnpm@8 | |
pnpm install && pnpm build | |
- name: Deploy 🚀 | |
uses: JamesIves/github-pages-deploy-action@v4.3.3 | |
with: | |
branch: gh-pages # The branch the action should deploy to. | |
folder: docs # The folder the action should deploy. | |
clean: true | |
publish-npm: | |
needs: build-and-deploy | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: 12 | |
registry-url: https://registry.npmjs.org/ | |
- run: npm publish --access public | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.npm_token}} | |
publish-gpr: | |
needs: build-and-deploy | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: 12 | |
registry-url: https://npm.pkg.github.com/ | |
- run: npm publish --access public | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.git_token}} |