Skip to content

Commit c8967a7

Browse files
committed
Add validation before deployment - only deploy if IGs pass validation
Changes: - Added validate-r4 and validate-r5 jobs that run first - Both validation jobs must pass before deployment starts - Deployment jobs now depend on successful validation - Updated documentation to reflect validation-then-deploy workflow This ensures only validated content is deployed to child repositories.
1 parent fb4e3bf commit c8967a7

2 files changed

Lines changed: 102 additions & 16 deletions

File tree

.github/workflows/README.md

Lines changed: 35 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
# Repository Deployment Setup
1+
# Repository Validation and Deployment Setup
22

3-
This document explains how to configure the automatic deployment workflow that syncs the content of `igs/imaging-r4` and `igs/imaging-r5` folders to separate repositories.
3+
This document explains how to configure the automatic validation and deployment workflow that:
4+
1. Validates R4 and R5 IGs using the FHIR IG Publisher
5+
2. Only deploys to child repositories if validation passes successfully
6+
3. Syncs the content of `igs/imaging-r4` and `igs/imaging-r5` folders to separate repositories
47

58
## Required Setup
69

@@ -38,19 +41,36 @@ Make sure the target repositories (`ehdsimaging-r4` and `ehdsimaging-r5`) exist
3841

3942
## How It Works
4043

41-
The workflow (`deploy-to-repos.yml`) triggers on any push to any branch and:
42-
43-
1. **Preprocessing**: Runs `_preprocessMultiVersion.sh` to prepare the files
44-
2. **R4 Deployment**:
45-
- Clones the target R4 repository
46-
- Creates or switches to the same branch name as the source
47-
- Syncs the content from `igs/imaging-r4/` to the root of the target repository
48-
- Commits and pushes changes if any exist
49-
3. **R5 Deployment**:
50-
- Clones the target R5 repository
51-
- Creates or switches to the same branch name as the source
52-
- Syncs the content from `igs/imaging-r5/` to the root of the target repository
53-
- Commits and pushes changes if any exist
44+
The workflow (`deploy-to-repos.yml`) triggers on any push to any branch and follows this sequence:
45+
46+
### **Step 1: Validation (Parallel)**
47+
- **validate-r4**: Validates the R4 IG
48+
- Runs preprocessing (`_preprocessMultiVersion.sh`)
49+
- Updates IG Publisher
50+
- Runs full validation (`_genonce.sh`)
51+
- **validate-r5**: Validates the R5 IG
52+
- Runs preprocessing (`_preprocessMultiVersion.sh`)
53+
- Updates IG Publisher
54+
- Runs full validation (`_genonce.sh`)
55+
56+
### **Step 2: Deployment (Only if validation passes)**
57+
If both validations succeed:
58+
- **deploy-r4**: Deploys to R4 repository
59+
- Runs preprocessing
60+
- Clones target R4 repository
61+
- Creates or switches to the same branch name as the source
62+
- Syncs content from `igs/imaging-r4/` to repository root
63+
- Commits and pushes changes
64+
- Creates build trigger for auto-ig-builder
65+
- **deploy-r5**: Deploys to R5 repository
66+
- Runs preprocessing
67+
- Clones target R5 repository
68+
- Creates or switches to the same branch name as the source
69+
- Syncs content from `igs/imaging-r5/` to repository root
70+
- Commits and pushes changes
71+
- Creates build trigger for auto-ig-builder
72+
73+
**If validation fails**: Deployment is skipped and the workflow stops with an error.
5474

5575
## Branch Handling
5676

.github/workflows/deploy-to-repos.yml

Lines changed: 67 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,78 @@
1-
name: Deploy to Separate Repositories
1+
name: Validate and Deploy to Separate Repositories
22

33
on:
44
push:
55
branches: ['**'] # Trigger on any branch push
66
workflow_dispatch: # Allow manual triggering
77

88
jobs:
9+
# Validation jobs run first
10+
validate-r4:
11+
runs-on: ubuntu-latest
12+
name: Validate R4 IG
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Install Jekyll
18+
run: sudo gem install jekyll
19+
20+
- name: Install Sushi
21+
run: sudo npm install -g fsh-sushi
22+
23+
- name: Preprocess
24+
run: |
25+
chmod u+x *.sh
26+
./_preprocessMultiVersion.sh
27+
28+
- name: Update IG publisher
29+
working-directory: ./igs/imaging-r4
30+
run: |
31+
pwd
32+
chmod +x ./_updatePublisher.sh
33+
./_updatePublisher.sh -y
34+
35+
- name: Validate R4 IG
36+
working-directory: ./igs/imaging-r4
37+
run: |
38+
pwd
39+
./_genonce.sh
40+
41+
validate-r5:
42+
runs-on: ubuntu-latest
43+
name: Validate R5 IG
44+
45+
steps:
46+
- uses: actions/checkout@v4
47+
48+
- name: Install Jekyll
49+
run: sudo gem install jekyll
50+
51+
- name: Install Sushi
52+
run: sudo npm install -g fsh-sushi
53+
54+
- name: Preprocess
55+
run: |
56+
chmod u+x *.sh
57+
./_preprocessMultiVersion.sh
58+
59+
- name: Update IG publisher
60+
working-directory: ./igs/imaging-r5
61+
run: |
62+
pwd
63+
chmod +x ./_updatePublisher.sh
64+
./_updatePublisher.sh -y
65+
66+
- name: Validate R5 IG
67+
working-directory: ./igs/imaging-r5
68+
run: |
69+
pwd
70+
./_genonce.sh
71+
72+
# Deployment jobs only run if validation passes
973
deploy-r4:
1074
runs-on: ubuntu-latest
75+
needs: [validate-r4, validate-r5] # Wait for both validations to pass
1176
if: github.event_name == 'push'
1277

1378
steps:
@@ -84,6 +149,7 @@ jobs:
84149
85150
deploy-r5:
86151
runs-on: ubuntu-latest
152+
needs: [validate-r4, validate-r5] # Wait for both validations to pass
87153
if: github.event_name == 'push'
88154

89155
steps:

0 commit comments

Comments
 (0)