md/.github/workflows/preview-build.yml

43 lines
889 B
YAML
Raw Normal View History

name: Preview Build
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
build-preview:
runs-on: ubuntu-latest
steps:
2023-05-10 17:23:23 +08:00
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
2021-12-03 17:33:53 +08:00
- name: Set up node
uses: actions/setup-node@v2
with:
2023-05-10 17:23:23 +08:00
node-version: 16
2021-12-03 17:33:53 +08:00
- name: Build
run: |
npm install
npm run build:h5-netlify
2021-12-03 17:33:53 +08:00
- name: Upload dist artifact
uses: actions/upload-artifact@v2
with:
name: dist
path: dist
retention-days: 5
2021-12-03 17:33:53 +08:00
- name: Save PR number
if: ${{ always() }}
run: echo ${{ github.event.number }} > ./pr-id.txt
2021-12-03 17:33:53 +08:00
- name: Upload PR number
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: pr
path: ./pr-id.txt