push #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
name: NodeJS with Webpack | |
on: | |
push: | |
branches: [ "develop_h5" ] | |
pull_request: | |
branches: [ "develop_h5" ] | |
permissions: | |
# 允许对仓库的内容进行写操作。包括创建、修改和删除文件、目录以及提交更改等 | |
# 这里只配置了push,所以只有推送main分支才会触发以下任务 | |
contents: write | |
# 允许管理 GitHub Pages 服务并对其进行写操作 | |
pages: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
# strategy: | |
# matrix: | |
# node-version: [16.x, 18.x] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
persist-credentials: false | |
- name: Use Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '16.x' | |
- name: Build | |
run: | | |
npm i --legacy-peer-deps --force | |
npm run vite:build --if-present | |
- name: Deploy | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} | |
branch: gh-pages # default: gh-pages | |
folder: dist | |
clean: true # Automatically remove deleted files from the deploy branch |