-
Notifications
You must be signed in to change notification settings - Fork 157
68 lines (56 loc) · 1.89 KB
/
surge.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# This workflow deploys a RepoSense report and the MarkBind documentation
# website to surge.sh in a secure manner for pull requests
name: Surge.sh build preview
on:
workflow_run:
workflows: ["Continuous Integration"]
types:
- completed
jobs:
deploy:
name: Deploy to surge.sh
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' }}
env:
NODE_VERSION: "lts/*"
GITHUB_TOKEN: ${{ github.token }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '16.x'
- name: Download deployment artifacts
uses: dawidd6/action-download-artifact@v2
with:
workflow: integration.yml
run_id: ${{ github.event.workflow_run.id }}
name: reposense-deployment
path: .
- name: Extract PR number
id: pr-number
run: echo 'ACTIONS_PR_NUMBER='$(cat ./pr/NUMBER) >> $GITHUB_OUTPUT
- name: Download deployment status artifacts
uses: dawidd6/action-download-artifact@v2
with:
workflow: pending.yml
pr: ${{ steps.pr-number.outputs.ACTIONS_PR_NUMBER }}
workflow_conclusion: success
name: reposense-deployment-id
path: ./pr
- name: Update PR checklist for surge.sh as in progress
if: ${{ success() }}
run: ./config/gh-actions/deploy.sh in_progress
- name: Install surge
if: ${{ success() }}
run: npm install -g surge
- name: Deploy to surge.sh
if: ${{ success() }}
env:
SURGE_LOGIN: ${{ secrets.SURGE_LOGIN }}
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }}
run: ./config/gh-actions/deploy.sh success
- name: Update PR checklist for surge.sh as failure
if: ${{ failure() }}
run: ./config/gh-actions/deploy.sh failure