docs: mark Resume to YAML Converter as completed in FUTURE_ENHANCEMEN… #72
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ==================================================================== | |
| # Terminal Portfolio - Automated Deployment | |
| # ==================================================================== | |
| # This workflow automatically builds and deploys your portfolio to | |
| # GitHub Pages when you push changes. | |
| # | |
| # 🌟 FOR TEMPLATE USERS: | |
| # - Triggers on push to 'main' branch (default) | |
| # - Just push your resume.yaml changes and it auto-deploys! | |
| # - No local installation of npm, Python, or RenderCV needed | |
| # | |
| # 🌿 FOR TEMPLATE OWNER (subhayu99): | |
| # - Triggers on 'main' and 'personal' branches | |
| # - Automatically skips deployment on main (template updates only) | |
| # - Deploys only from 'personal' branch (actual portfolio) | |
| # | |
| # 📚 Documentation: | |
| # - Branch Workflow: See BRANCH_WORKFLOW.md | |
| # - Template Users: See README.md | |
| # ==================================================================== | |
| name: Deploy Portfolio | |
| on: | |
| push: | |
| branches: [ main, personal ] | |
| pull_request: | |
| branches: [ main, personal ] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| # Skip this job if running on template repo's main branch | |
| if: github.repository != 'subhayu99/subhayu99.github.io' || github.ref != 'refs/heads/main' | |
| steps: | |
| - name: 📥 Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: 🔧 Setup Node.js 20 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: 🐍 Setup Python 3.11 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: 📦 Install RenderCV | |
| run: pip install "rendercv[full]" | |
| - name: 📦 Install npm dependencies | |
| run: npm ci | |
| - name: 🎨 Setup template files (if needed) | |
| run: | | |
| echo "Setting up template configuration files..." | |
| # Copy example files if user hasn't created their own | |
| if [ ! -f "resume.yaml" ]; then | |
| echo "⚠️ No resume.yaml found - using example resume" | |
| cp resume.yaml.example resume.yaml | |
| fi | |
| # Only copy neofetch files as fallbacks (these are optional customizations) | |
| # styled_name.txt and manifest.json will be auto-generated by the build script | |
| if [ ! -f "client/public/data/neofetch.txt" ]; then | |
| echo "📝 Copying neofetch.txt from example" | |
| cp client/public/data/neofetch.txt.example client/public/data/neofetch.txt | |
| fi | |
| if [ ! -f "client/public/data/neofetch-small.txt" ]; then | |
| echo "📝 Copying neofetch-small.txt from example" | |
| cp client/public/data/neofetch-small.txt.example client/public/data/neofetch-small.txt | |
| fi | |
| echo "✅ Template setup complete!" | |
| - name: 🔧 Compute base path for deployment | |
| id: compute-base-path | |
| run: | | |
| # Extract repository name from GITHUB_REPOSITORY (format: owner/repo) | |
| REPO_NAME="${GITHUB_REPOSITORY#*/}" | |
| REPO_OWNER="${GITHUB_REPOSITORY%/*}" | |
| # Check if this is a user/org GitHub Pages site (username.github.io) | |
| if [ "$REPO_NAME" = "${REPO_OWNER}.github.io" ]; then | |
| # User/org site: use root path | |
| BASE_PATH="/" | |
| echo "📍 Detected user/org site: ${REPO_NAME}" | |
| else | |
| # Project site: use /repo-name/ path | |
| BASE_PATH="/${REPO_NAME}/" | |
| echo "📍 Detected project site: ${REPO_NAME}" | |
| fi | |
| echo "🔗 Base path: ${BASE_PATH}" | |
| echo "BASE_PATH=${BASE_PATH}" >> $GITHUB_OUTPUT | |
| - name: 🏗️ Build application | |
| # Note: npm run build now automatically generates resume files if resume.yaml exists | |
| run: npm run build | |
| env: | |
| VITE_BASE_PATH: ${{ steps.compute-base-path.outputs.BASE_PATH }} | |
| - name: ⚙️ Configure GitHub Pages | |
| uses: actions/configure-pages@v4 | |
| - name: 📤 Upload build artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: './dist/public' | |
| deploy: | |
| name: 🚀 Deploy to GitHub Pages | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| needs: build | |
| # Skip this job if running on template repo's main branch | |
| if: github.repository != 'subhayu99/subhayu99.github.io' || github.ref != 'refs/heads/main' | |
| steps: | |
| - name: 🌐 Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 | |
| - name: ✅ Deployment complete | |
| run: | | |
| echo "🎉 Your portfolio is now live!" | |
| echo "🔗 URL: ${{ steps.deployment.outputs.page_url }}" | |
| echo "" | |
| echo "To update your portfolio, just push changes to the personal branch." | |
| echo "The site will automatically rebuild and redeploy!" |