Skip to content

Commit 4a4c0f0

Browse files
committed
Replaces direct deployment workflow with merge-based approach for cvclaude branch
Replaces the direct deployment workflow for the cvclaude branch with a merge-based approach that builds the cvclaude branch and merges its content into the main branch's 360 subfolder. This change eliminates the need for a separate deployment workflow for the cvclaude branch and instead integrates its content into the main deployment process, simplifying the deployment pipeline while maintaining the same functionality. Updates documentation to reflect the new workflow structure and explains the merge-based approach for the cvclaude branch content.
1 parent a66420a commit 4a4c0f0

3 files changed

Lines changed: 69 additions & 77 deletions

File tree

.github/workflows/cvclaude-360.yml

Lines changed: 0 additions & 66 deletions
This file was deleted.
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Workflow to merge cvclaude branch content into main branch's 360 subfolder
2+
name: Merge CVClaude to 360 subfolder
3+
4+
on:
5+
# Runs on pushes targeting the cvclaude branch
6+
push:
7+
branches: ["cvclaude"]
8+
9+
# Allows you to run this workflow manually from the Actions tab
10+
workflow_dispatch:
11+
12+
jobs:
13+
merge-to-main:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout main branch
17+
uses: actions/checkout@v4
18+
with:
19+
ref: main
20+
token: ${{ secrets.GITHUB_TOKEN }}
21+
22+
- name: Checkout cvclaude branch
23+
uses: actions/checkout@v4
24+
with:
25+
ref: cvclaude
26+
path: cvclaude-build
27+
28+
- name: Setup Node.js for cvclaude build
29+
run: npm install
30+
working-directory: ./cvclaude-build
31+
32+
- name: Build cvclaude for 360 subfolder
33+
run: npm run build
34+
working-directory: ./cvclaude-build
35+
env:
36+
BASE_PATH: /cv/360
37+
38+
- name: Create or update 360 subfolder in main
39+
run: |
40+
# Remove existing 360 folder if it exists
41+
rm -rf 360
42+
# Create 360 folder
43+
mkdir -p 360
44+
# Copy built files from cvclaude to 360 folder
45+
cp -r cvclaude-build/*.html cvclaude-build/*.css cvclaude-build/*.js 360/ 2>/dev/null || true
46+
# Clean up cvclaude-build directory
47+
rm -rf cvclaude-build
48+
49+
- name: Commit and push changes to main
50+
run: |
51+
git config --local user.email "action@github.com"
52+
git config --local user.name "GitHub Action"
53+
git add 360/
54+
git commit -m "Update 360 subfolder with cvclaude branch content [skip ci]" || echo "No changes to commit"
55+
git push

MULTI_BRANCH_DEPLOYMENT.md

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ This project now supports deploying multiple branches to GitHub Pages with diffe
1111

1212
### GitHub Actions Workflows
1313

14-
Two separate workflows handle the deployments:
14+
Two workflows handle the deployments:
1515

1616
#### Main Branch Workflow ([`static.yml`](.github/workflows/static.yml))
1717
- **Trigger**: Runs on pushes to `main` branch only
1818
- **Deployment**: Deploys to root path (`.`)
1919

20-
#### CVClaude Branch Workflow ([`cvclaude-360.yml`](.github/workflows/cvclaude-360.yml))
21-
- **Trigger**: Runs on pushes to `cvclaude` branch only
22-
- **Deployment**: Deploys to `/360` subfolder
20+
#### CVClaude Merge Workflow ([`merge-cvclaude-to-360.yml`](.github/workflows/merge-cvclaude-to-360.yml))
21+
- **Trigger**: Runs on pushes to `cvclaude` branch
22+
- **Action**: Builds cvclaude branch and merges content into main branch's `/360` subfolder
2323
- **Configuration**: Uses `BASE_PATH=/cv/360` environment variable
2424

2525
### Build Process Modifications
@@ -53,19 +53,22 @@ GitHub Pages Structure:
5353

5454
## How It Works
5555

56-
### 1. Separate Workflows
57-
58-
Each branch has its own dedicated workflow:
56+
### 1. Main Branch Deployment
5957

6058
**Main Branch Workflow** ([`static.yml`](.github/workflows/static.yml)):
6159
- Triggers on `main` branch pushes
6260
- Builds with default settings (root deployment)
63-
- Deploys files to root directory
61+
- Deploys files to root directory via GitHub Pages
62+
63+
### 2. CVClaude Branch Integration
6464

65-
**CVClaude Branch Workflow** ([`cvclaude-360.yml`](.github/workflows/cvclaude-360.yml)):
65+
**CVClaude Merge Workflow** ([`merge-cvclaude-to-360.yml`](.github/workflows/merge-cvclaude-to-360.yml)):
6666
- Triggers on `cvclaude` branch pushes
67-
- Builds with `BASE_PATH=/cv/360` environment variable
68-
- Moves files to `360/` subdirectory before deployment
67+
- Checks out both `main` and `cvclaude` branches
68+
- Builds cvclaude branch with `BASE_PATH=/cv/360` environment variable
69+
- Copies built files to `360/` subfolder in main branch
70+
- Commits and pushes changes to main branch
71+
- This triggers the main branch workflow to redeploy with updated 360 subfolder
6972

7073
### 2. Build Configuration
7174

0 commit comments

Comments
 (0)