fix: 修复不正常工作 #12
This file contains hidden or 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
| name: Build and Deploy to GitHub Pages | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Source | |
| uses: actions/checkout@v2 | |
| with: | |
| ref: main | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v1 | |
| with: | |
| node-version: '17' | |
| - name: Setup Cache | |
| uses: actions/cache@v3 | |
| env: | |
| cache-name: cache-node-modules | |
| with: | |
| # npm cache files are stored in `~/.npm` on Linux/macOS | |
| path: ~/.npm | |
| key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-build-${{ env.cache-name }}- | |
| ${{ runner.os }}-build- | |
| ${{ runner.os }}- | |
| - name: Setup Webpack & Install Dependences | |
| run: | | |
| git config --global user.email "64469437+Yuameshi@users.noreply.github.com" | |
| git config --global user.name "Yuameshi" | |
| npm install webpack-cli webpack -g | |
| npm install | |
| - name: Build | |
| run: npm run build | |
| - name: Deploy | |
| uses: peaceiris/actions-gh-pages@v3 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./dist | |
| - name: Trigger APP CI Build | |
| run: | | |
| curl 'https://api.github.com/repos/Yuameshi/PhiCommunityAPP/dispatches' --request POST \ | |
| -H 'Accept: application/vnd.github.v3+json' \ | |
| -H 'Content-Type: application/json' \ | |
| -H 'Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \ | |
| --data-raw '{"event_type": "CI Build triggered by Repo:PhiCommunity"}' |