generated from geo-smart/simple-template
-
Notifications
You must be signed in to change notification settings - Fork 2
45 lines (38 loc) · 1.36 KB
/
deployonly.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: PR Preview
on:
workflow_run:
workflows: ["PR Build"]
types:
- completed
permissions:
pull-requests: write # allow surge-preview to create/update PR comments
concurrency:
group: ${{ github.workflow }}-${{ github.event.workflow_run.id }}
cancel-in-progress: true
jobs:
preview:
# environment: SurgePreviewPR
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' }}
steps:
# Download built HTML from PR Build workflow
- uses: actions/download-artifact@v4
continue-on-error: true
with:
github-token: ${{ github.token }}
run-id: ${{ github.event.workflow_run.id }}
- name: Manage Surge deployment
id: preview_step
#uses: afc163/surge-preview@v1
uses: scottyhq/surge-preview@pr-status
with:
surge_token: ${{ secrets.SURGE_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
build: echo 'Uploading html/ folder contents to Surge.sh...'
dist: html # NOTE: matchupload_artifact name: html
failOnError: true
teardown: true
- name: Format preview url
id: format_url
run: |
echo "url_text=:rocket: Preview deployed at https://${{ steps.preview_step.outputs.preview_url }}" >> $GITHUB_OUTPUT