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
@@ -60,17 +60,43 @@ This approach reduces maintenance burden by significantly. Adding new content re
60
60
61
61
**Custom Components**: The `_includes/header.html` file implements navigation filtering to exclude pages with `nav_exclude: true` in their front matter, enabling draft pages and hidden content.
62
62
63
-
## 2. CI/CD Pipeline
63
+
## 3. CI/CD Pipeline
64
64
65
-
The main branch has protections in place that prevent direct pushes without a pull request. To merge a pull request into main, a test deployment must first be made successfully.
65
+
The main branch has protections in place that prevent direct pushes without a pull request. To merge a pull request into main, a test build and preview deployment must first complete successfully.
66
66
67
-
### 1. Pull Request Preview (`test-gh-pages.yml`)
67
+
### 3.1. Pull Request Preview Workflow
68
68
69
-
-**Trigger**: PR creation/reopening or manual dispatch
70
-
-**Purpose**: Validates that site builds successfully before merging to `main`
71
-
-**Process**: Identical build steps to production workflow but deploys to `github-pages-test` environment
69
+
When you open a PR from `dev` to `main`, two automated processes run:
72
70
73
-
### 2. Production Deployment (`deploy-gh-pages.yml`)
71
+
#### GitHub Actions Build (`test-gh-pages.yml`)
72
+
-**Trigger**: PR opened/reopened/synchronized or manual dispatch
73
+
-**Purpose**: Validates that site builds successfully with the Makefile-based workflow
74
+
-**Process**:
75
+
1. Checks out repository code
76
+
2. Sets up Ruby environment
77
+
3. Runs `make build-github` to build site with production config
78
+
4. Posts comment on PR with Render preview URL
79
+
-**Output**: Build status check on PR
80
+
81
+
#### Render.com Preview Deployment
82
+
-**Trigger**: PR opened from `dev` branch (automatic via Render PR preview feature)
83
+
-**Purpose**: Creates a live preview of changes before merging to production
84
+
-**Process**:
85
+
1. Installs Ruby dependencies: `cd site && bundle install`
86
+
2. Builds site with Render config: `make build-render` (uses merged `_config.yml` + `_config_render.yml`)
87
+
3. Deploys to temporary preview URL: `fsa-devops-preview-pr-{NUMBER}.onrender.com`
88
+
-**URL Format**: Each PR gets a unique preview URL (e.g., `fsa-devops-preview-pr-42.onrender.com`)
89
+
-**Lifecycle**: Preview deployment is automatically deleted when PR is closed/merged
90
+
-**Config Files**:
91
+
-`site/_config.yml`: Production config with `baseurl: "/FSA_devops"`
92
+
-`site/_config_render.yml`: Override config with empty baseurl for root-level deployment
93
+
94
+
**Why Two Configs?**
95
+
- GitHub Pages deploys to a subpath: `gperdrizet.github.io/FSA_devops/`
96
+
- Render deploys to root: `fsa-devops-preview-pr-42.onrender.com/`
97
+
- Jekyll's `relative_url` filter uses `baseurl` to generate correct URLs for each environment
98
+
99
+
### 3.2. Production Deployment (`deploy-gh-pages.yml`)
74
100
75
101
-**Trigger**: Pushes to `main` branch or manual dispatch
76
102
-**Process**:
@@ -89,42 +115,102 @@ The main branch has protections in place that prevent direct pushes without a pu
89
115
- Validates YAML syntax and Liquid template logic
90
116
- Ensures asset copying and file structure integrity
91
117
- Provides build status checks on PRs via badges
118
+
- Enables visual review of changes before production deployment
119
+
- Supports collaborative review with live preview links
120
+
121
+
## 4. Build System
122
+
123
+
The repository uses a Makefile-based build system for consistent asset management and Jekyll compilation across environments.
124
+
125
+
### Available Make Targets
126
+
127
+
```bash
128
+
make help# Show all available targets
129
+
make install # Install Ruby dependencies (bundle install)
130
+
make clean # Remove built site and copied assets
131
+
make copy-notebooks # Copy notebooks to site/assets/notebooks
132
+
make copy-data # Copy datasets to site/assets/data
133
+
make copy-resources # Copy resources.md to site/
134
+
make copy-all # Run all copy targets
135
+
make build-github # Build for GitHub Pages (with baseurl)
136
+
make build-render # Build for Render.com (without baseurl)
137
+
make serve-local # Start local Jekyll server
138
+
make validate-links # Check for broken internal links
139
+
```
140
+
141
+
### Multi-Environment Support
92
142
93
-
## 3. Development Workflow
143
+
The build system supports two deployment targets:
144
+
145
+
**GitHub Pages** (`make build-github`):
146
+
- Uses `site/_config.yml` only
147
+
- Sets `baseurl: "/FSA_devops"` for subpath deployment
0 commit comments