fix: workflows #2
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
name: NodeJS with Webpack | |
on: | |
push: | |
branches: ["master"] | |
pull_request: | |
branches: ["master"] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [20.x] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install dependencies | |
run: | | |
npm install -g pnpm | |
pnpm install | |
- name: Build project | |
run: pnpm run build:h5 | |
- name: Deploy on master branch | |
if: github.ref == 'refs/heads/master' && github.event_name == 'push' && github.event.pull_request == null | |
run: | | |
export COMMIT_MSG="$(git log --format='%h - %B' --no-merges -n 1)" | |
export COMMIT_USER="$(git log --no-merges -n 1 --format=%an)" | |
export COMMIT_EMAIL="$(git log --no-merges -n 1 --format=%ae)" | |
export ROT_TOKEN="${{ secrets.GITHUB_TOKEN }}" | |
sh build/deploy-ci.sh |