Skip to content

Adds workflow to trigger static deployment after merging cvclaude branch #16

Adds workflow to trigger static deployment after merging cvclaude branch

Adds workflow to trigger static deployment after merging cvclaude branch #16

# Workflow to merge cvclaude branch content into main branch's 360 subfolder
name: Merge CVClaude to 360 subfolder
on:
# Runs on pushes targeting the cvclaude branch
push:
branches: ["cvclaude"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
permissions:
contents: write
jobs:
merge-to-main:
runs-on: ubuntu-latest
steps:
- name: Checkout main branch
uses: actions/checkout@v4
with:
ref: main
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
- name: Checkout cvclaude branch
uses: actions/checkout@v4
with:
ref: cvclaude
path: cvclaude-build
- name: Setup Node.js for cvclaude build
run: npm install
working-directory: ./cvclaude-build
- name: Build cvclaude for 360 subfolder
run: npm run build
working-directory: ./cvclaude-build
env:
BASE_PATH: /cv/360
- name: Create or update 360 subfolder in main
run: |
# Remove existing 360 folder if it exists
rm -rf 360
# Create 360 folder
mkdir -p 360
# Copy ONLY the built HTML files and minified CSS to 360 folder
cp cvclaude-build/index.html cvclaude-build/index-fr.html cvclaude-build/index-en.html cvclaude-build/style.min.css 360/
# List files in 360 folder to verify
echo "Files copied to 360 folder:"
ls -la 360/
# Clean up cvclaude-build directory
rm -rf cvclaude-build
# Show git status to debug
echo "Git status after copying files:"
git status
- name: Commit and push changes to main
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
# Add files explicitly with verification
echo "Checking if 360/ files exist:"
ls -la 360/
# Add files individually with force flag to override .gitignore
git add -f 360/index.html
git add -f 360/index-fr.html
git add -f 360/index-en.html
git add -f 360/style.min.css
git status
git commit -m "Update 360 subfolder with cvclaude branch content" || echo "No changes to commit"
git push origin main
- name: Trigger static deployment workflow
run: |
# Trigger the static.yml workflow manually using GitHub API
curl -X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
https://api.github.com/repos/${{ github.repository }}/actions/workflows/static.yml/dispatches \
-d '{"ref":"main"}'