File tree Expand file tree Collapse file tree 1 file changed +11
-17
lines changed Expand file tree Collapse file tree 1 file changed +11
-17
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ concurrency:
11
11
12
12
jobs :
13
13
preview :
14
+ env :
15
+ PREVIEW_URL : https://{{repository.owner}}-{{repository.name}}-{{job.name}}-pr-{{pr.number}}.surge.sh
14
16
runs-on : ubuntu-latest
15
17
steps :
16
18
- name : Checkout repository
@@ -41,26 +43,18 @@ jobs:
41
43
run : |
42
44
if (test -a _build/html/reports/*log); then cat _build/html/reports/*log ; fi
43
45
44
- - name : Publish to Surge
45
- id : preview_step
46
- uses : afc163/surge-preview@v1
47
- with :
48
- surge_token : ${{ secrets.SURGE_TOKEN }}
49
- github_token : ${{ secrets.GITHUB_TOKEN }}
50
- failOnError : true
51
- dist : _build/html
52
- build : |
53
- npm install
54
- npm run build
55
-
56
46
- name : Format preview url
57
47
id : format_url
58
48
run : |
59
- echo "url_text=:rocket: Preview deployed at https://${{ steps.preview_step.outputs.preview_url }}" >> $GITHUB_OUTPUT
49
+ echo "url_text=:rocket: Preview deployed at >> $GITHUB_OUTPUT
50
+
51
+ - name : Install Surge.sh
52
+ uses : actions/setup-node@v4
53
+
54
+ - run : npm install -g surge
60
55
61
- - name : Get the preview_url
62
- run : echo "${{ steps.format_url.outputs.url_text }}"
56
+ - run : surge ./_build/html {{env.PREVIEW_URL}} --token ${{ secrets.SURGE_TOKEN }}
63
57
64
- - name : Generate summary
58
+ - name : Add URL to Summary
65
59
run : |
66
- echo "#### ${{ steps.format_url.outputs.url_text }}" >> $GITHUB_STEP_SUMMARY
60
+ echo "#### :rocket: Preview deployed at {{env.PREVIEW_URL }}" >> $GITHUB_STEP_SUMMARY
You can’t perform that action at this time.
0 commit comments