File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 9292
9393 echo "✅ Template setup complete!"
9494
95- - name : 🔧 Compute base path for deployment
95+ - name : 🔧 Compute base path and deployment URL
9696 id : compute-base-path
9797 run : |
9898 # Extract repository name from GITHUB_REPOSITORY (format: owner/repo)
@@ -103,21 +103,26 @@ jobs:
103103 if [ "$REPO_NAME" = "${REPO_OWNER}.github.io" ]; then
104104 # User/org site: use root path
105105 BASE_PATH="/"
106+ SITE_URL="https://${REPO_OWNER}.github.io"
106107 echo "📍 Detected user/org site: ${REPO_NAME}"
107108 else
108109 # Project site: use /repo-name/ path
109110 BASE_PATH="/${REPO_NAME}/"
111+ SITE_URL="https://${REPO_OWNER}.github.io/${REPO_NAME}"
110112 echo "📍 Detected project site: ${REPO_NAME}"
111113 fi
112114
113115 echo "🔗 Base path: ${BASE_PATH}"
116+ echo "🌐 Site URL: ${SITE_URL}"
114117 echo "BASE_PATH=${BASE_PATH}" >> $GITHUB_OUTPUT
118+ echo "SITE_URL=${SITE_URL}" >> $GITHUB_OUTPUT
115119
116120 - name : 🏗️ Build application
117121 # Note: npm run build now automatically generates resume files if resume.yaml exists
118122 run : npm run build
119123 env :
120124 VITE_BASE_PATH : ${{ steps.compute-base-path.outputs.BASE_PATH }}
125+ VITE_SITE_URL : ${{ steps.compute-base-path.outputs.SITE_URL }}
121126
122127
123128 - name : ⚙️ Configure GitHub Pages
Original file line number Diff line number Diff line change 2323 location: "San Francisco, CA"
2424 email: "jane@example.com"
2525 phone: "tel:+1-555-0123"
26+ # 🌐 Optional: Will auto-fill with GitHub Pages URL if left empty
2627 website: "https://janedeveloper.dev"
2728 resume_url: "https://janedeveloper.dev/resume.pdf"
2829 social_networks:
Original file line number Diff line number Diff line change 1414 *
1515 * Environment variables:
1616 * NODE_ENV or RESUME_ENV - Set environment (development, production, ci)
17+ * VITE_SITE_URL - Auto-injected GitHub Pages URL (set by CI/CD workflow)
1718 * Example: NODE_ENV=production node scripts/generate-resume.js
1819 */
1920
@@ -265,6 +266,15 @@ if (!existsSync(sourceYamlPath)) {
265266const yamlContent = readFileSync ( sourceYamlPath , 'utf8' ) ;
266267const fullData = load ( yamlContent , { sortKeys : false } ) ;
267268
269+ // Auto-inject website URL if missing (from GitHub Pages deployment URL)
270+ if ( fullData . cv && ( ! fullData . cv . website || fullData . cv . website . trim ( ) === '' ) ) {
271+ const deploymentUrl = process . env . VITE_SITE_URL ;
272+ if ( deploymentUrl ) {
273+ fullData . cv . website = deploymentUrl ;
274+ console . log ( `🌐 Auto-injecting website URL: ${ deploymentUrl } ` ) ;
275+ }
276+ }
277+
268278// Log original section order for debugging
269279if ( config . build . verbose && fullData . cv ?. sections ) {
270280 const originalSectionNames = Object . keys ( fullData . cv . sections ) ;
You can’t perform that action at this time.
0 commit comments