-
Notifications
You must be signed in to change notification settings - Fork 27
47 lines (46 loc) · 1.54 KB
/
preview.yml
File metadata and controls
47 lines (46 loc) · 1.54 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: 'preview'
on: # rebuild any PRs and main branch changes
pull_request_target:
# use default types + closed event type
types: [opened, synchronize, reopened, closed]
jobs:
preview: # make sure the action works on a clean machine without building
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: refs/pull/${{ github.event.pull_request.number }}/merge
- uses: ./
id: preview_step
name: test afc163/surge-preview
with:
surge_token: ${{ secrets.SURGE_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
teardown: 'true'
dist: public/preview
build: |
mkdir -p public/preview
npm install
npm run build-preview -- public/preview
- name: Get the output url
run: echo "url => ${{ steps.preview_step.outputs.preview_url }}"
preview2:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: refs/pull/${{ github.event.pull_request.number }}/merge
- uses: ./
id: preview_action
name: test afc163/surge-preview
with:
surge_token: ${{ secrets.SURGE_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
teardown: 'true'
dist: public/preview2
build: |
mkdir -p public/preview2
npm install
npm run build-preview -- public/preview2
- name: Get the output url
run: echo "url => ${{ steps.preview_action.outputs.preview_url }}"