-
Notifications
You must be signed in to change notification settings - Fork 4
45 lines (39 loc) · 1.6 KB
/
surge-pr-fork-03-teardown.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
42
43
44
45
name: Surge PR Preview - Teardown Stage
on:
pull_request_target:
# To manage 'surge-preview' action teardown on PR closed
types: [closed]
branches:
- master
# keep in sync with the build stage
paths:
- '.github/workflows/surge-pr-fork-01-build.yml'
- '.github/workflows/surge-pr-fork-02-deploy.yml'
- 'public/surge/**/*'
permissions:
pull-requests: write # surge-preview creates or updates PR comments about the deployment status
jobs:
deploy: # MUST be kept in sync with the job id of the deploy stage (used in the deployment URL)
runs-on: ${{ vars.RUNNER_UBUNTU }}
steps:
- uses: bonitasoft/actions/packages/surge-preview-tools@v3
id: surge-preview-tools
with:
surge-token: ${{ secrets.SURGE_TOKEN }}
- name: Echo surge preview tools output
run: |
echo "can-run-surge-command: ${{ steps.surge-preview-tools.outputs.can-run-surge-command }}"
echo "domain-exist: ${{ steps.surge-preview-tools.outputs.domain-exist }}"
echo "preview-url: ${{ steps.surge-preview-tools.outputs.preview-url }}"
echo "surge-token-valid: ${{ steps.surge-preview-tools.outputs.surge-token-valid }}"
- name: Teardown demo preview
if: steps.surge-preview-tools.outputs.can-run-surge-command == 'true'
id: publish_demo_preview
uses: afc163/surge-preview@v1
with:
surge_token: ${{ secrets.SURGE_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
failOnError: true
teardown: true
build: |
performing teardown