-
Notifications
You must be signed in to change notification settings - Fork 102
134 lines (112 loc) · 5.6 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
name: Sync Pact docs
on:
repository_dispatch:
types:
- pact-js-docs-updated
- pact-jvm-docs-updated
- pact-python-docs-updated
- pact-go-docs-updated
- pact-php-docs-updated
- pact-rust-docs-updated
- pact-cpp-docs-updated
- pact-broker-docker-pactfoundation-docs-updated
- pact-broker-docker-dius-docs-updated
- pact-broker-helm-chart-docs-updated
- pact-broker-client-docs-updated
- pact-net-docs-updated
- pact-broker-docs-updated
- pact-plugins-docs-updated
workflow_dispatch:
inputs:
update_event:
type: choice
description: Which event happened?
required: true
options:
- pact-js-docs-updated
- pact-jvm-docs-updated
- pact-python-docs-updated
- pact-go-docs-updated
- pact-php-docs-updated
- pact-rust-docs-updated
- pact-cpp-docs-updated
- pact-broker-docker-pactfoundation-docs-updated
- pact-broker-docker-dius-docs-updated
- pact-broker-helm-chart-docs-updated
- pact-broker-client-docs-updated
- pact-net-docs-updated
- pact-broker-docs-updated
- pact-plugins-docs-updated
- all-docs-updated
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ruby/[email protected]
with:
ruby-version: '3.3'
- 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 Pact JS docs
run: bundle exec scripts/sync/pact_js.rb && echo 'COMMIT_MESSAGE=synced pact-js docs' >> $GITHUB_ENV
if: steps.identify_event.outputs.update_event == 'pact-js-docs-updated'
- name: Sync Pact JVM docs
run: bundle exec scripts/sync/pact_jvm.rb && echo 'COMMIT_MESSAGE=synced pact-jvm docs' >> $GITHUB_ENV
if: steps.identify_event.outputs.update_event == 'pact-jvm-docs-updated'
- name: Sync Pact Python docs
run: bundle exec scripts/sync/pact_python.rb && echo 'COMMIT_MESSAGE=synced pact-python docs' >> $GITHUB_ENV
if: steps.identify_event.outputs.update_event == 'pact-python-docs-updated'
- name: Sync Pact Go docs
run: bundle exec scripts/sync/pact_go.rb && echo 'COMMIT_MESSAGE=synced pact-go docs' >> $GITHUB_ENV
if: steps.identify_event.outputs.update_event == 'pact-go-docs-updated'
- name: Sync Pact PHP docs
run: bundle exec scripts/sync/pact_php.rb && echo 'COMMIT_MESSAGE=synced pact-php docs' >> $GITHUB_ENV
if: steps.identify_event.outputs.update_event == 'pact-php-docs-updated'
- name: Sync Pact Rust docs
run: bundle exec scripts/sync/pact_rust.rb && echo 'COMMIT_MESSAGE=synced pact-rust docs' >> $GITHUB_ENV
if: steps.identify_event.outputs.update_event == 'pact-rust-docs-updated'
- name: Sync Pact C++ docs
run: bundle exec scripts/sync/pact_cpp.rb && echo 'COMMIT_MESSAGE=synced pact-cpp docs' >> $GITHUB_ENV
if: steps.identify_event.outputs.update_event == 'pact-cpp-docs-updated'
- name: Sync Pact Broker docs
run: bundle exec scripts/sync/pact_broker.rb && echo 'COMMIT_MESSAGE=synced pact_broker docs' >> $GITHUB_ENV
if: steps.identify_event.outputs.update_event == 'pact-broker-docs-updated'
- name: Sync pactfoundation/pact-broker Docker image docs
run: bundle exec scripts/sync/pact_broker_docker_pactfoundation.rb && echo 'COMMIT_MESSAGE=synced pactfoundation/pact-broker docker image docs' >> $GITHUB_ENV
if: steps.identify_event.outputs.update_event == 'pact-broker-docker-pactfoundation-docs-updated'
- name: Sync dius/pact-broker Docker image docs
run: bundle exec scripts/sync/pact_broker_docker_dius.rb && echo 'COMMIT_MESSAGE=synced dius/pact-broker docker image docs' >> $GITHUB_ENV
if: steps.identify_event.outputs.update_event == 'pact-broker-docker-dius-docs-updated'
- name: Sync Pact Broker Helm Chart docs
run: bundle exec scripts/sync/pact_broker_helm_chart.rb && echo 'COMMIT_MESSAGE=synced pact-broker Helm Chart docs' >> $GITHUB_ENV
if: steps.identify_event.outputs.update_event == 'pact-broker-helm-chart-docs-updated'
- name: Sync Pact Broker Client docs
run: bundle exec scripts/sync/pact_broker_client.rb && echo 'COMMIT_MESSAGE=synced pact broker client docs' >> $GITHUB_ENV
if: steps.identify_event.outputs.update_event == 'pact-broker-client-docs-updated'
- name: Sync Pact Net docs
run: bundle exec scripts/sync/pact_net.rb && echo 'COMMIT_MESSAGE=synced pact-net docs' >> $GITHUB_ENV
if: steps.identify_event.outputs.update_event == 'pact-net-docs-updated'
- name: Sync Pact Plugins docs
run: bundle exec scripts/sync/pact_plugins.rb && echo 'COMMIT_MESSAGE=synced pact-plugins docs' >> $GITHUB_ENV
if: steps.identify_event.outputs.update_event == 'pact-plugins-docs-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'
- uses: actions/setup-node@v2
with:
node-version: '16'
- name: Build
run: scripts/build.sh
- name: Commit and push changes
uses: EndBug/add-and-commit@v4
with:
add: 'website/docs'
author_name: Github Action
author_email: [email protected]
message: 'chore: ${{ env.COMMIT_MESSAGE }}'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Leave this line unchanged