generated from geo-smart/simple-template
-
Notifications
You must be signed in to change notification settings - Fork 2
60 lines (51 loc) · 1.8 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
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:
# - name: Debug step
# run: |
# echo "workflow_run: ${{toJSON(github.event.workflow_run)}}"
# echo "workflow_run.head_sha: ${{github.event.workflow_run.head_sha}}"
- uses: actions/download-artifact@v4
with:
github-token: ${{ github.token }}
run-id: ${{ github.event.workflow_run.id }}
path: html
# name: my-other-artifact
# github-token: ${{ secrets.GH_PAT }} # token with actions:read permissions on target repo
# repository: actions/toolkit
# run-id: 1234
- name: List directory contents
run: |
pwd
ls -lh
ls html
ls html/*
du -sh *
# - name: download dist artifact
# uses: dawidd6/action-download-artifact@v5
# with:
# workflow: ${{ github.event.workflow_run.workflow_id }}
# name: pr-build-dist # must be kept in sync with the artifact name downloaded in the build stage
# path: site/
- name: Manage Surge deployment
uses: afc163/surge-preview@v1
with:
surge_token: ${{ secrets.SURGE_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
build: echo 'Uploading html/ folder contents to Surge.sh...'
dist: html/
failOnError: true