26
26
27
27
permissions :
28
28
contents : read
29
- deployments : write
29
+ # deployments: write
30
30
pull-requests : write
31
31
statuses : write
32
32
issues : write
@@ -35,41 +35,41 @@ jobs:
35
35
deploy :
36
36
runs-on : ubuntu-latest
37
37
steps :
38
- - name : get pull request ref
39
- id : get_pull_request_ref
40
-
41
- with :
42
- route : GET /repos/:repository/pulls/:issue_id
43
- repository : ${{ github.repository }}
44
- issue_id : ${{ github.event.number }}
45
- env :
46
- GITHUB_TOKEN : " ${{ secrets.GITHUB_TOKEN }}"
38
+ # - name: get pull request ref
39
+ # id: get_pull_request_ref
40
+
41
+ # with:
42
+ # route: GET /repos/:repository/pulls/:issue_id
43
+ # repository: ${{ github.repository }}
44
+ # issue_id: ${{ github.event.number }}
45
+ # env:
46
+ # GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
47
47
48
- - name : create deployment
49
- id : create_deployment
50
-
51
- with :
52
- route : POST /repos/:repository/deployments
53
- repository : ${{ github.repository }}
54
- ref : ${{ github.event.pull_request.base.ref }}
55
- environment : dev
56
- auto_merge : false
57
- required_contexts : " []"
58
- env :
59
- GITHUB_TOKEN : " ${{ secrets.GITHUB_TOKEN }}"
48
+ # - name: create deployment
49
+ # id: create_deployment
50
+
51
+ # with:
52
+ # route: POST /repos/:repository/deployments
53
+ # repository: ${{ github.repository }}
54
+ # ref: ${{ github.event.pull_request.base.ref }}
55
+ # environment: dev
56
+ # auto_merge: false
57
+ # required_contexts: "[]"
58
+ # env:
59
+ # GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
60
60
61
- - name : set deployment status to in progress
62
- id : start_deployment
63
-
64
- with :
65
- route : POST /repos/:repository/deployments/:deployment/statuses
66
- repository : ${{ github.repository }}
67
- deployment : ${{ fromJson(steps.create_deployment.outputs.data).id }}
68
- environment : dev
69
- log_url : https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
70
- state : in_progress
71
- env :
72
- GITHUB_TOKEN : " ${{ secrets.GITHUB_TOKEN }}"
61
+ # - name: set deployment status to in progress
62
+ # id: start_deployment
63
+
64
+ # with:
65
+ # route: POST /repos/:repository/deployments/:deployment/statuses
66
+ # repository: ${{ github.repository }}
67
+ # deployment: ${{ fromJson(steps.create_deployment.outputs.data).id }}
68
+ # environment: dev
69
+ # log_url: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
70
+ # state: in_progress
71
+ # env:
72
+ # GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
73
73
74
74
# deployment goes here
75
75
- name : Checkout
@@ -87,35 +87,35 @@ jobs:
87
87
- name : Remove pdfs (filesize restraints)
88
88
run : rm _site/pdfs/*.pdf
89
89
- name : deploy to surge
90
- run : npm run surge -- --token "${{ secrets.SURGE_TOKEN }}" --domain liputenpotest-${{ github.event.number }}.surge.sh
90
+ run : npm run surge -- --token "${{ secrets.SURGE_TOKEN }}" --domain liputenpotest-${{ github.event.number }}.surge.sh
91
91
92
- - name : set deployment status to success
93
- id : successful_deployment
94
-
95
- with :
96
- route : POST /repos/:repository/deployments/:deployment/statuses
97
- repository : ${{ github.repository }}
98
- deployment : ${{ fromJson(steps.create_deployment.outputs.data).id }}
99
- environment : dev
100
- environment_url : https://liputenpotest-${{ github.event.number }}.surge.sh
101
- log_url : https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
102
- state : success
103
- env :
104
- GITHUB_TOKEN : " ${{ secrets.GITHUB_TOKEN }}"
92
+ # - name: set deployment status to success
93
+ # id: successful_deployment
94
+
95
+ # with:
96
+ # route: POST /repos/:repository/deployments/:deployment/statuses
97
+ # repository: ${{ github.repository }}
98
+ # deployment: ${{ fromJson(steps.create_deployment.outputs.data).id }}
99
+ # environment: dev
100
+ # environment_url: https://liputenpotest-${{ github.event.number }}.surge.sh
101
+ # log_url: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
102
+ # state: success
103
+ # env:
104
+ # GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
105
105
106
- - name : set deployment status to failure
107
- id : failed_deployment
108
-
109
- if : failure()
110
- with :
111
- route : POST /repos/:repository/deployments/:deployment/statuses
112
- repository : ${{ github.repository }}
113
- deployment : ${{ fromJson(steps.create_deployment.outputs.data).id }}
114
- environment : dev
115
- log_url : https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
116
- state : failure
117
- env :
118
- GITHUB_TOKEN : " ${{ secrets.GITHUB_TOKEN }}"
106
+ # - name: set deployment status to failure
107
+ # id: failed_deployment
108
+
109
+ # if: failure()
110
+ # with:
111
+ # route: POST /repos/:repository/deployments/:deployment/statuses
112
+ # repository: ${{ github.repository }}
113
+ # deployment: ${{ fromJson(steps.create_deployment.outputs.data).id }}
114
+ # environment: dev
115
+ # log_url: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
116
+ # state: failure
117
+ # env:
118
+ # GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
119
119
120
120
# - name: Send confirmation
121
121
# id: send_confirmation
@@ -124,6 +124,36 @@ jobs:
124
124
# route: POST /repos/:repository/issues/:issue_id/comments
125
125
# repository: ${{ github.repository }}
126
126
# issue_id: ${{ github.event.number }}
127
- # body: "deployed to <https://liputenpotest-${{ github.event.number }}.surge.sh>"
127
+ # body: "surge: deployed to <https://liputenpotest-${{ github.event.number }}.surge.sh>"
128
128
# env:
129
129
# GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
130
+
131
+ - name : Find Comment
132
+ uses : peter-evans/find-comment@v1
133
+ id : fc
134
+ with :
135
+ issue-number : ${{ github.event.pull_request.number }}
136
+ comment-author : " github-actions[bot]"
137
+ body-includes : " surge: "
138
+ env :
139
+ GITHUB_TOKEN : " ${{ secrets.GITHUB_TOKEN }}"
140
+
141
+ - name : Create comment
142
+ if : steps.fc.outputs.comment-id == ''
143
+ uses : peter-evans/create-or-update-comment@v1
144
+ with :
145
+ issue-number : ${{ github.event.pull_request.number }}
146
+ body : |
147
+ surge: deployed to <https://liputenpotest-${{ github.event.number }}.surge.sh>
148
+ env :
149
+ GITHUB_TOKEN : " ${{ secrets.GITHUB_TOKEN }}"
150
+
151
+ - name : Update comment
152
+ if : steps.fc.outputs.comment-id != ''
153
+ uses : peter-evans/create-or-update-comment@v1
154
+ with :
155
+ comment-id : ${{ steps.fc.outputs.comment-id }}
156
+ body : |
157
+ surge: deployed to <https://liputenpotest-${{ github.event.number }}.surge.sh>
158
+ env :
159
+ GITHUB_TOKEN : " ${{ secrets.GITHUB_TOKEN }}"
0 commit comments