Skip to content

Commit a66420a

Browse files
committed
Adds dedicated workflow for CVClaude branch deployment
Splits deployment logic into separate workflows for better maintainability - Creates new workflow for CVClaude branch targeting /360 subfolder - Updates main workflow to only deploy main branch - Simplifies build configuration by removing branch detection logic - Improves documentation to reflect the new architecture
1 parent 5d2272a commit a66420a

3 files changed

Lines changed: 94 additions & 30 deletions

File tree

.github/workflows/cvclaude-360.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Workflow for deploying cvclaude branch to 360 subfolder
2+
name: Deploy 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+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
13+
permissions:
14+
contents: read
15+
pages: write
16+
id-token: write
17+
18+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
19+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
20+
concurrency:
21+
group: "pages-360"
22+
cancel-in-progress: false
23+
24+
jobs:
25+
# Single deploy job since we're just deploying
26+
deploy:
27+
environment:
28+
name: github-pages
29+
url: ${{ steps.deployment.outputs.page_url }}
30+
runs-on: ubuntu-latest
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v4
34+
with:
35+
ref: cvclaude
36+
37+
- name: Setup Node.js
38+
uses: actions/setup-node@v4
39+
with:
40+
node-version: '20'
41+
42+
- name: Install dependencies
43+
run: npm install
44+
45+
- name: Build project for 360 subfolder
46+
run: npm run build
47+
env:
48+
BASE_PATH: /cv/360
49+
50+
- name: Prepare 360 deployment directory
51+
run: |
52+
mkdir -p 360
53+
mv *.html *.css *.js 360/ 2>/dev/null || true
54+
55+
- name: Setup Pages
56+
uses: actions/configure-pages@v5
57+
58+
- name: Upload artifact
59+
uses: actions/upload-pages-artifact@v3
60+
with:
61+
# Upload 360 directory
62+
path: '360'
63+
64+
- name: Deploy to GitHub Pages
65+
id: deployment
66+
uses: actions/deploy-pages@v4

.github/workflows/static.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
name: Deploy static content to Pages
33

44
on:
5-
# Runs on pushes targeting the main and cvclaude branches
5+
# Runs on pushes targeting the main branch only
66
push:
7-
branches: ["main", "cvclaude"]
7+
branches: ["main"]
88

99
# Allows you to run this workflow manually from the Actions tab
1010
workflow_dispatch:
@@ -25,7 +25,7 @@ jobs:
2525
# Single deploy job since we're just deploying
2626
deploy:
2727
environment:
28-
name: github-pages
28+
name: ${{ github.ref == 'refs/heads/main' && 'github-pages' || 'github-pages-cvclaude' }}
2929
url: ${{ steps.deployment.outputs.page_url }}
3030
runs-on: ubuntu-latest
3131
steps:

MULTI_BRANCH_DEPLOYMENT.md

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,18 @@ This project now supports deploying multiple branches to GitHub Pages with diffe
99

1010
## Architecture
1111

12-
### GitHub Actions Workflow
12+
### GitHub Actions Workflows
1313

14-
The [`static.yml`](.github/workflows/static.yml) workflow has been modified to:
14+
Two separate workflows handle the deployments:
1515

16-
1. **Trigger on both branches**: Runs on pushes to `main` and `cvclaude` branches
17-
2. **Branch Detection**: Uses conditional logic to determine deployment path
18-
3. **Dynamic Path Configuration**:
19-
- `main` branch → root deployment (`.`)
20-
- `cvclaude` branch → subfolder deployment (`360`)
16+
#### Main Branch Workflow ([`static.yml`](.github/workflows/static.yml))
17+
- **Trigger**: Runs on pushes to `main` branch only
18+
- **Deployment**: Deploys to root path (`.`)
19+
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
23+
- **Configuration**: Uses `BASE_PATH=/cv/360` environment variable
2124

2225
### Build Process Modifications
2326

@@ -50,22 +53,19 @@ GitHub Pages Structure:
5053

5154
## How It Works
5255

53-
### 1. Branch Detection
56+
### 1. Separate Workflows
5457

55-
The workflow detects the current branch using `github.ref`:
58+
Each branch has its own dedicated workflow:
5659

57-
```yaml
58-
- name: Determine deployment path
59-
id: deployment-path
60-
run: |
61-
if [[ "${{ github.ref }}" == "refs/heads/cvclaude" ]]; then
62-
echo "DEPLOYMENT_PATH=360" >> $GITHUB_OUTPUT
63-
echo "BASE_PATH=/cv/360" >> $GITHUB_OUTPUT
64-
else
65-
echo "DEPLOYMENT_PATH=." >> $GITHUB_OUTPUT
66-
echo "BASE_PATH=/cv" >> $GITHUB_OUTPUT
67-
fi
68-
```
60+
**Main Branch Workflow** ([`static.yml`](.github/workflows/static.yml)):
61+
- Triggers on `main` branch pushes
62+
- Builds with default settings (root deployment)
63+
- Deploys files to root directory
64+
65+
**CVClaude Branch Workflow** ([`cvclaude-360.yml`](.github/workflows/cvclaude-360.yml)):
66+
- Triggers on `cvclaude` branch pushes
67+
- Builds with `BASE_PATH=/cv/360` environment variable
68+
- Moves files to `360/` subdirectory before deployment
6969

7070
### 2. Build Configuration
7171

@@ -98,15 +98,13 @@ if (CONFIG.basePath) {
9898

9999
### 4. Deployment
100100

101-
Files are moved to the appropriate directory before upload:
101+
For CVClaude branch, files are moved to the 360 subdirectory:
102102

103103
```yaml
104-
- name: Prepare deployment directory
104+
- name: Prepare 360 deployment directory
105105
run: |
106-
if [[ "${{ steps.deployment-path.outputs.DEPLOYMENT_PATH }}" != "." ]]; then
107-
mkdir -p ${{ steps.deployment-path.outputs.DEPLOYMENT_PATH }}
108-
mv *.html *.css *.js ${{ steps.deployment-path.outputs.DEPLOYMENT_PATH }}/ 2>/dev/null || true
109-
fi
106+
mkdir -p 360
107+
mv *.html *.css *.js 360/ 2>/dev/null || true
110108
```
111109
112110
## Testing

0 commit comments

Comments
 (0)