-
Notifications
You must be signed in to change notification settings - Fork 15
240 lines (200 loc) · 14.8 KB
/
sync-docs.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
name: Sync Pact docs
on:
workflow_dispatch:
inputs:
update_event:
type: choice
description: Which event happened?
required: true
options:
- pactflow-docs-updated
- pactflow-example-consumer-cypress
- pactflow-example-consumer-dotnet-updated
- pactflow-example-provider-dotnet-updated
- pactflow-example-consumer-golang-updated
- pactflow-example-provider-golang-updated
- pactflow-example-consumer-java-junit-updated
- pactflow-example-provider-java-spring-boot-updated
- pactflow-example-consumer-java-kafka-updated
- pactflow-example-consumer-js-kafka-updated
- pactflow-example-provider-java-kafka-updated
- pactflow-example-consumer-js-updated
- pactflow-example-provider-js-updated
- pactflow-example-consumer-java-soap-updated
- pactflow-example-provider-java-soap-updated
- pactflow-example-consumer-python-updated
- pactflow-example-provider-python-updated
- pactflow-example-consumer-js-sns-updated
- pactflow-example-provider-js-sns-updated
- pact-workshop-js-updated
- pactflow-example-bi-directional-consumer-nock-updated
- pactflow-example-bi-directional-consumer-wiremock-updated
- pactflow-example-bi-directional-consumer-cypress-updated
- pactflow-example-bi-directional-consumer-mountebank-updated
- pactflow-example-bi-directional-consumer-msw-js-updated
- pactflow-example-bi-directional-consumer-playwright-js-updated
- pactflow-example-bi-directional-consumer-dotnet-updated
- pactflow-example-bi-directional-provider-dredd-updated
- pactflow-example-bi-directional-provider-postman-updated
- pactflow-example-bi-directional-provider-restassured-updated
- pactflow-example-bi-directional-provider-readyapi-updated
- pactflow-example-bi-directional-provider-soapui-updated
- pactflow-example-bi-directional-provider-dotnet-updated
- all-docs-updated
repository_dispatch:
types:
- pactflow-docs-updated
- pactflow-example-consumer-cypress
- pactflow-example-consumer-dotnet-updated
- pactflow-example-provider-dotnet-updated
- pactflow-example-consumer-golang-updated
- pactflow-example-provider-golang-updated
- pactflow-example-consumer-java-junit-updated
- pactflow-example-provider-java-spring-boot-updated
- pactflow-example-consumer-java-kafka-updated
- pactflow-example-consumer-js-kafka-updated
- pactflow-example-provider-java-kafka-updated
- pactflow-example-consumer-js-updated
- pactflow-example-provider-js-updated
- pactflow-example-consumer-java-soap-updated
- pactflow-example-provider-java-soap-updated
- pactflow-example-consumer-python-updated
- pactflow-example-provider-python-updated
- pactflow-example-consumer-js-sns-updated
- pactflow-example-provider-js-sns-updated
- pact-workshop-js-updated
- pactflow-example-bi-directional-consumer-nock-updated
- pactflow-example-bi-directional-consumer-wiremock-updated
- pactflow-example-bi-directional-consumer-cypress-updated
- pactflow-example-bi-directional-consumer-mountebank-updated
- pactflow-example-bi-directional-consumer-msw-js-updated
- pactflow-example-bi-directional-consumer-playwright-js-updated
- pactflow-example-bi-directional-consumer-dotnet-updated
- pactflow-example-bi-directional-provider-dredd-updated
- pactflow-example-bi-directional-provider-postman-updated
- pactflow-example-bi-directional-provider-restassured-updated
- pactflow-example-bi-directional-provider-readyapi-updated
- pactflow-example-bi-directional-provider-soapui-updated
- pactflow-example-bi-directional-provider-dotnet-updated
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: "2.7"
- run: bundle install --without test development
- id: identify_event
run: echo "update_event=${{ github.event.action }}${{ github.event.inputs.update_event }}" >> $GITHUB_OUTPUT
- name: Sync example_consumer_cypress docs
run: bundle exec scripts/sync/example_consumer_cypress.rb && echo 'COMMIT_MESSAGE=synced pactflow_consumer_cypress docs' >> $GITHUB_ENV
if: steps.identify_event.outputs.update_event == 'pactflow-example-consumer-cypress'
- name: Sync example_consumer_dotnet docs
run: bundle exec scripts/sync/example_consumer_dotnet.rb && echo 'COMMIT_MESSAGE=synced example_consumer_dotnet docs' >> $GITHUB_ENV
if: steps.identify_event.outputs.update_event == 'pactflow-example-consumer-dotnet-updated'
- name: Sync example_provider_dotnet docs
run: bundle exec scripts/sync/example_provider_dotnet.rb && echo 'COMMIT_MESSAGE=synced example_provider_dotnet docs' >> $GITHUB_ENV
if: steps.identify_event.outputs.update_event == 'pactflow-example-provider-dotnet-updated'
- name: Sync example_consumer_java_kafka docs
run: bundle exec scripts/sync/example_consumer_java_kafka.rb && echo 'COMMIT_MESSAGE=synced example_consumer_java_kafka docs' >> $GITHUB_ENV
if: steps.identify_event.outputs.update_event == 'pactflow-example-consumer-java-kafka-updated'
- name: Sync example_consumer_js docs
run: bundle exec scripts/sync/example_consumer_js.rb && echo 'COMMIT_MESSAGE=synced example_consumer_js docs' >> $GITHUB_ENV
if: steps.identify_event.outputs.update_event == 'pactflow-example-consumer-js-updated'
- name: Sync example_consumer_js_kafka docs
run: bundle exec scripts/sync/example_consumer_js_kafka.rb && echo 'COMMIT_MESSAGE=synced example_consumer_js_kafka docs' >> $GITHUB_ENV
if: steps.identify_event.outputs.update_event == 'pactflow-example-consumer-js-kafka-updated'
- name: Sync example_provider_java_kafka docs
run: bundle exec scripts/sync/example_provider_java_kafka.rb && echo 'COMMIT_MESSAGE=synced example_provider_java_kafka docs' >> $GITHUB_ENV
if: steps.identify_event.outputs.update_event == 'pactflow-example-provider-java-kafka-updated'
- name: Sync example_consumer_java_soap docs
run: bundle exec scripts/sync/example_consumer_java_soap.rb && echo 'COMMIT_MESSAGE=synced example_consumer_java_kafka docs' >> $GITHUB_ENV
if: steps.identify_event.outputs.update_event == 'pactflow-example-consumer-java-soap-updated'
- name: Sync example_provider_java_soap docs
run: bundle exec scripts/sync/example_provider_java_soap.rb && echo 'COMMIT_MESSAGE=synced example_provider_js_kafka docs' >> $GITHUB_ENV
if: steps.identify_event.outputs.update_event == 'pactflow-example-provider-java-soap-updated'
- name: Sync example_provider_java_spring_boot docs
run: bundle exec scripts/sync/example_provider_java_spring_boot.rb && echo 'COMMIT_MESSAGE=synced example_provider_java_spring_boot docs' >> $GITHUB_ENV
if: steps.identify_event.outputs.update_event == 'pactflow-example-provider-java-spring-boot-updated'
- name: Sync example_consumer_java_junit docs
run: bundle exec scripts/sync/example_consumer_java_junit.rb && echo 'COMMIT_MESSAGE=synced example_consumer_java_junit docs' >> $GITHUB_ENV
if: steps.identify_event.outputs.update_event == 'pactflow-example-consumer-java-junit-updated'
- name: Sync example_provider_js docs
run: bundle exec scripts/sync/example_provider_js.rb && echo 'COMMIT_MESSAGE=synced example_provider_js docs' >> $GITHUB_ENV
if: steps.identify_event.outputs.update_event == 'pactflow-example-provider-js-updated'
- name: Sync example_consumer_python docs
run: bundle exec scripts/sync/example_consumer_python.rb && echo 'COMMIT_MESSAGE=synced example_consumer_python docs' >> $GITHUB_ENV
if: steps.identify_event.outputs.update_event == 'pactflow-example-consumer-python-updated'
- name: Sync example_provider_python docs
run: bundle exec scripts/sync/example_provider_python.rb && echo 'COMMIT_MESSAGE=synced example_provider_python docs' >> $GITHUB_ENV
if: steps.identify_event.outputs.update_event == 'pactflow-example-provider-python-updated'
- name: Sync pact-js-workshop docs
run: bundle exec scripts/sync/introduction_workshop.rb && echo 'COMMIT_MESSAGE=synced introduction_workshop docs' >> $GITHUB_ENV
if: steps.identify_event.outputs.update_event == 'pact-workshop-js-updated'
- name: Sync example_consumer_js_sns docs
run: bundle exec scripts/sync/example_consumer_js_sns.rb && echo 'COMMIT_MESSAGE=synced example_consumer_js_sns docs' >> $GITHUB_ENV
if: steps.identify_event.outputs.update_event == 'pactflow-example-consumer-js-sns-updated'
- name: Sync example_provider_js_sns docs
run: bundle exec scripts/sync/example_provider_js_sns.rb && echo 'COMMIT_MESSAGE=synced example_provider_js_sns docs' >> $GITHUB_ENV
if: steps.identify_event.outputs.update_event == 'pactflow-example-provider-js-sns-updated'
- name: Sync example_consumer_golang docs
run: bundle exec scripts/sync/example_consumer_golang.rb && echo 'COMMIT_MESSAGE=synced example_consumer_golang docs' >> $GITHUB_ENV
if: steps.identify_event.outputs.update_event == 'pactflow-example-consumer-golang-updated'
- name: Sync example_provider_golang docs
run: bundle exec scripts/sync/example_provider_golang.rb && echo 'COMMIT_MESSAGE=synced example_provider_golang docs' >> $GITHUB_ENV
if: steps.identify_event.outputs.update_event == 'pactflow-example-provider-golang-updated'
- name: Sync example_provider_bidirectional_dredd docs
run: bundle exec scripts/sync/example_provider_bidirectional_dredd.rb && echo 'COMMIT_MESSAGE=synced example_provider_bidirectional_dredd docs' >> $GITHUB_ENV
if: steps.identify_event.outputs.update_event == 'pactflow-example-bi-directional-provider-dredd-updated'
- name: Sync example_provider_bidirectional_postman docs
run: bundle exec scripts/sync/example_provider_bidirectional_postman.rb && echo 'COMMIT_MESSAGE=synced example_provider_bidirectional_postman docs' >> $GITHUB_ENV
if: steps.identify_event.outputs.update_event == 'pactflow-example-bi-directional-provider-postman-updated'
- name: Sync example_provider_bidirectional_restassured docs
run: bundle exec scripts/sync/example_provider_bidirectional_restassured.rb && echo 'COMMIT_MESSAGE=synced example_provider_bidirectional_restassured docs' >> $GITHUB_ENV
if: steps.identify_event.outputs.update_event == 'pactflow-example-bi-directional-provider-restassured-updated'
- name: Sync example_provider_bidirectional_readyapi docs
run: bundle exec scripts/sync/example_provider_bidirectional_readyapi.rb && echo 'COMMIT_MESSAGE=synced example_provider_bidirectional_readyapi docs' >> $GITHUB_ENV
if: steps.identify_event.outputs.update_event == 'pactflow-example-bi-directional-provider-readyapi-updated'
- name: Sync example_provider_bidirectional_soapui docs
run: bundle exec scripts/sync/example_provider_bidirectional_soapui.rb && echo 'COMMIT_MESSAGE=synced example_provider_bidirectional_soapui docs' >> $GITHUB_ENV
if: steps.identify_event.outputs.update_event == 'pactflow-example-bi-directional-provider-soapui-updated'
- name: Sync example_consumer_bidirectional_wiremock docs
run: bundle exec scripts/sync/example_consumer_bidirectional_wiremock.rb && echo 'COMMIT_MESSAGE=synced example_consumer_bidirectional_wiremock docs' >> $GITHUB_ENV
if: steps.identify_event.outputs.update_event == 'pactflow-example-bi-directional-consumer-wiremock-updated'
- name: Sync example_provider_bidirectional_dotnet docs
run: bundle exec scripts/sync/example_provider_bidirectional_dotnet_schemathesis.rb && echo 'COMMIT_MESSAGE=synced example_provider_bidirectional_dotnet docs' >> $GITHUB_ENV
if: steps.identify_event.outputs.update_event == 'pactflow-example-bi-directional-provider-dotnet-updated'
- name: Sync example_consumer_bidirectional_dotnet docs
run: bundle exec scripts/sync/example_consumer_bidirectional_dotnet.rb && echo 'COMMIT_MESSAGE=synced example_consumer_bidirectional_dotnet docs' >> $GITHUB_ENV
if: steps.identify_event.outputs.update_event == 'pactflow-example-bi-directional-consumer-dotnet-updated'
- name: Sync example_consumer_bidirectional_cypress docs
run: bundle exec scripts/sync/example_consumer_bidirectional_cypress.rb && echo 'COMMIT_MESSAGE=synced example_consumer_bidirectional_cypress docs' >> $GITHUB_ENV
if: steps.identify_event.outputs.update_event == 'pactflow-example-bi-directional-consumer-cypress-updated'
- name: Sync example_consumer_bidirectional_mountebank docs
run: bundle exec scripts/sync/example_consumer_bidirectional_mountebank.rb && echo 'COMMIT_MESSAGE=synced example_consumer_bidirectional_mountebank docs' >> $GITHUB_ENV
if: steps.identify_event.outputs.update_event == 'pactflow-example-bi-directional-consumer-mountebank-updated'
- name: Sync example_consumer_bidirectional_msw docs
run: bundle exec scripts/sync/example_consumer_bidirectional_msw.rb && echo 'COMMIT_MESSAGE=synced example_consumer_bidirectional_msw docs' >> $GITHUB_ENV
if: steps.identify_event.outputs.update_event == 'pactflow-example-bi-directional-consumer-msw-js-updated'
- name: Sync example_consumer_bidirectional_nock docs
run: bundle exec scripts/sync/example_consumer_bidirectional_nock.rb && echo 'COMMIT_MESSAGE=synced example_consumer_bidirectional_nock docs' >> $GITHUB_ENV
if: steps.identify_event.outputs.update_event == 'pactflow-example-bi-directional-consumer-nock-updated'
- name: Sync example_consumer_bidirectional_playwright_js docs
run: bundle exec scripts/sync/example_consumer_bidirectional_playwright_js.rb && echo 'COMMIT_MESSAGE=synced example_consumer_bidirectional_playwright_js docs' >> $GITHUB_ENV
if: steps.identify_event.outputs.update_event == 'pactflow-example-bi-directional-consumer-playwright-js-updated'
- name: Sync all docs
run: bundle exec scripts/sync/all.sh && echo 'COMMIT_MESSAGE=synced all docs' >> $GITHUB_ENV
if: steps.identify_event.outputs.update_event == 'all-docs-updated'
- name: Commit and push changes
uses: EndBug/add-and-commit@v9
with:
add: 'website'
author_name: Github Action
author_email: docs@pact.io
message: 'chore: ${{ env.COMMIT_MESSAGE }}'
new_branch: ${{ steps.identify_event.outputs.update_event }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Leave this line unchanged