preview-build.yml 806 B

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