-
-
Notifications
You must be signed in to change notification settings - Fork 118
26 lines (24 loc) · 980 Bytes
/
pr-preview.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
name: Generate Preview
on:
issue_comment:
types: [created]
jobs:
deploy_preview:
name: Deploy Preview of PR
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v1
- uses: actions/checkout@v2
- run: npm install yaml -s
- run: echo "::set-env name=worker::$( node ./scripts/deploy-preview/verify.js ${{ github.event.comment.user.login }} "$COMMENT_BODY" )"
env:
COMMENT_BODY: ${{github.event.comment.body}}
- if: env.worker == 'true'
run: |
git fetch origin +refs/pull/${{ github.event.issue.number }}/merge
git checkout -f FETCH_HEAD
npm install -s
CI=false npm run build
mv ./build/index.html ./build/200.html
npm install randomstring surge @actions/github -s
node ./scripts/deploy-preview/deploy.js ${{ github.event.issue.number }} ${{ secrets.SURGE_TOKEN }} ${{ secrets.GITHUB_TOKEN }} ${{ github.event.comment.user.login }}