86133 | aaa3f5d | 2025-04-20 21:33:29 +0800 | [diff] [blame] | 1 | name: Preview Build |
| 2 | |
| 3 | on: |
| 4 | pull_request: |
| 5 | types: [opened, synchronize, reopened] |
| 6 | |
| 7 | permissions: |
| 8 | contents: read |
| 9 | |
| 10 | jobs: |
| 11 | build-preview: |
| 12 | runs-on: ubuntu-latest |
| 13 | |
| 14 | steps: |
| 15 | - uses: actions/checkout@v2 |
| 16 | with: |
| 17 | ref: ${{ github.event.pull_request.head.sha }} |
| 18 | |
| 19 | - name: build |
| 20 | run: | |
| 21 | yarn |
| 22 | yarn add umi-plugin-pro --save |
| 23 | yarn build |
| 24 | |
| 25 | - name: upload dist artifact |
| 26 | uses: actions/upload-artifact@v2 |
| 27 | with: |
| 28 | name: dist |
| 29 | path: dist/ |
| 30 | retention-days: 5 |
| 31 | |
| 32 | - name: Save PR number |
| 33 | if: ${{ always() }} |
| 34 | run: echo ${{ github.event.number }} > ./pr-id.txt |
| 35 | |
| 36 | - name: Upload PR number |
| 37 | if: ${{ always() }} |
| 38 | uses: actions/upload-artifact@v2 |
| 39 | with: |
| 40 | name: pr |
| 41 | path: ./pr-id.txt |