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