-
Notifications
You must be signed in to change notification settings - Fork 1
41 lines (39 loc) · 1.29 KB
/
deploy-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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Deploy PR preview
on:
pull_request:
# To manage 'surge-preview' action teardown, add default event types + closed event type
types: [opened, synchronize, reopened, closed]
branches:
- main
paths:
- '.github/actions/build/**/*'
- '.github/workflows/deploy-pr-preview.yml'
- 'src/**/*'
- '.nvmrc'
- 'index.html'
- 'package.json'
- 'package-lock.json'
jobs:
demo_preview: # keep unique across jobs using surge preview (preview url and PR comment id)
runs-on: ubuntu-latest
permissions:
pull-requests: write # surge-preview: PR comments
steps:
- uses: actions/checkout@v3
- name: Build
uses: ./.github/actions/build
if: github.event.action != 'closed'
- uses: bonitasoft/actions/packages/surge-preview-tools@v2
id: surge-preview-tools
with:
surge-token: ${{ secrets.SURGE_TOKEN }}
- name: Manage surge preview
if: steps.surge-preview-tools.outputs.can-run-surge-command == 'true'
uses: afc163/surge-preview@v1
with:
surge_token: ${{ secrets.SURGE_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
dist: './dist'
failOnError: true
teardown: 'true'
build: echo 'already built!'