This repository has been archived by the owner on Nov 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
232 lines (200 loc) · 6.3 KB
/
deploy.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
name: Deploy to GitHub pages
on:
push:
branches: [ main ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ main ]
schedule:
- cron: '0 6 * * *'
workflow_dispatch:
permissions:
contents: write
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
jobs:
create-artifacts:
name: Create entity relationship artifacts
runs-on: ubuntu-latest
env:
RAILS_ENV: test
DB_USERNAME: postgres
DB_PASSWORD: postgres
DB_HOSTNAME: localhost
DB_PORT: 5432
ANALYTICS_DB_USERNAME: postgres
ANALYTICS_DB_PASSWORD: postgres
ANALYTICS_DB_HOSTNAME: localhost
ANALYTICS_DB_PORT: 5432
services:
postgres:
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout
uses: actions/checkout@v3
with:
repository: DFE-Digital/early-careers-framework
- name: Setup Graphviz
uses: ts-graphviz/setup-graphviz@v1
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version: '3.2.2'
- name: Install rails-erd
run: |
bundle config unset deployment
bundle add rails-erd
- name: Set up test database
run: bin/rails db:create db:schema:load
- name: create erd config file
uses: DamianReeves/[email protected]
with:
path: ./.erdconfig
contents: |
attributes:
- content
disconnected: false
filename: tmp/entity-relationship-diagram
filetype: pdf
indirect: false
inheritance: false
markup: true
notation: bachman
orientation: vertical
polymorphism: false
sort: true
warn: false
title: Teacher Continuing Professional Development - ERD
exclude:
- Record
- ApplicationRecord
- DiscardableRecord
- Item
- ApiToken
- NPQRegistrationApiToken
- EngageAndLearnApiToken
- LeadProviderApiToken
- DataStudioApiToken
- PaperTrail::Version
- ActiveRecord::SessionStore::Session
- ActiveStorage::Record
- ActiveStorage::Blob
- ActiveStorage::VariantRecord
- ActiveStorage::Attachment
- Delayed::Backend::ActiveRecord::Job
- Analytics::BaseRecord
- Feature
- Feature::SelectedObject
- DataStage::SchoolLink
- DataStage::School
- DataStage::SchoolChange
- ActionMailbox::Record
- ActionMailbox::InboundEmail
- AdminProfile
- AdditionalSchoolEmail
- NominationEmail
- PartnershipNotificationEmail
- PartnershipCsvUpload
- PrivacyPolicy::Acceptance
- PrivacyPolicy
- Email
- Email::Association
- Owner
- EventLog
- ApiRequest
- ApiRequestAudit
- InductionCoordinatorProfile
- FinanceProfile
- LeadProviderProfile
- DeliveryPartnerProfile
- InductionCoordinatorProfilesSchool
- Finance::Statement::ECF::Paid
- Finance::Statement::ECF::Payable
- Finance::Statement::NPQ::Paid
- Finance::Statement::NPQ::Payable
- Finance::Schedule::NPQLeadership
- Finance::Schedule::NPQSpecialist
- Finance::Schedule::NPQSupport
- Finance::Schedule::ECF
- Finance::Schedule::Mentor
- Finance::Schedule::NPQ
- Finance::Schedule::NPQEhco
only: null
only_recursion_depth: null
prepend_primary: false
cluster: true
splines: curved
write-mode: overwrite
- name: Create ERD DOT
run: bundle exec erd --filetype=dot
- name: Create ERD PDF
run: bundle exec erd --filetype=pdf
- name: Create ERD PNG
run: bundle exec erd --filetype=png
- name: Publish diagrams
uses: actions/upload-artifact@v2
with:
name: Teacher CPD - entity relationship Diagram
path: ./tmp/entity-relationship-diagram.*
update-diagrams:
if: ${{ github.event_name != 'pull_request' }}
name: Update entity relationship artifacts
runs-on: ubuntu-latest
needs: create-artifacts
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Get diagrams
uses: actions/download-artifact@v2
with:
name: Teacher CPD - entity relationship Diagram
path: ./source/images
- name: Push updated diagram
run: |
git config user.name github-actions
git config user.email [email protected]
git add .
git commit -m "updated entity relationship diagram"
git push origin
build-and-push:
if: ${{ github.event_name != 'pull_request' }}
name: Build and deploy service manual
runs-on: ubuntu-latest
needs: update-diagrams
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version: '3.2.2'
# - name: Validate C4 Models
# run: ./bin/c4-validate.sh
# continue-on-error: true
#
# - name: Generate C4 Views
# run: ./bin/c4-to-plantuml.sh
#
# - name: Generate Images and documents for C4 views
# run: ./bin/plantuml-to-png.sh
- name: Build docs with middleman
run: make build
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: 'build'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2