You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+39-17Lines changed: 39 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,6 @@ This repository contains an automated CI/CD pipeline for the `main-mvp` branch t
17
17
- Automatically updates deployment configurations
18
18
- Deploys to Integration environment via ArgoCD
19
19
20
-
21
20
### Branch Structure
22
21
23
22
```
@@ -176,14 +175,48 @@ Most of these can be installed with Homebrew on a Mac.
176
175
177
176
### Getting Started
178
177
179
-
First run `yarn`
178
+
#### 1. Run the rake task
180
179
181
-
Then run `bin/setup` to bundle, etc
180
+
```bash
181
+
bundle exec rake markdown:render
182
+
```
182
183
183
-
Then run `rails s`.
184
+
⚠️ This is a required step to see content in the app. This is a one time setup step and you can run it again whenever you make changes to the markdown files located at `app/content`.
184
185
185
-
Or: `yarn && bundle exec rails s`
186
+
#### 2. Build the dependencies
186
187
188
+
```bash
189
+
yarn
190
+
```
191
+
yarn installs the node dependencies and builds the assets for the app.
192
+
193
+
```bash
194
+
bin/setup
195
+
```
196
+
This will install the ruby dependencies and start the server on `http://localhost:3000` and you can view the app in your browser.
197
+
198
+
199
+
#### 3. Run the server
200
+
201
+
```
202
+
bundle exec rails s
203
+
```
204
+
Or
205
+
```
206
+
yarn && bundle exec rails s
207
+
```
208
+
209
+
### Markdown rendering
210
+
211
+
The markdown rendering executed by the rake task `markdown:render` is a two step process:
212
+
213
+
1. The markdown files located at `app/content` are parsed and the content is extracted.
214
+
215
+
2. The content is then used to create or update the corresponding content in the `app/views/generated/collections` directory.
216
+
217
+
⚠️ The generated files are ignored by git and are not meant to be edited directly. Any changes to the content should be made in the markdown files and the rake task should be run again to see the changes reflected in the app.
218
+
219
+
This rake task is also used in the CI pipeline to ensure that any changes to the markdown files are reflected in the app when deployed.
187
220
188
221
## Deployment
189
222
@@ -196,15 +229,4 @@ See [the developer docs on data.gov.uk deployment](https://docs.publishing.servi
The markdown contents live in the `app/content` directory. The markdown parser rake task (`lib/tasks/markdown_to_static_html.rake`) will parse the markdown files, read the front matter, body and create or update the corresponding content in `app/views/generated/collections` directory. This allows us to manage content in markdown files while still being able to serve it dynamically.
204
-
205
-
### How to run the markdown parser rake task locally
0 commit comments