From caa35fa03e0d9e5781ab45b9b480182a73dc3f91 Mon Sep 17 00:00:00 2001 From: Dzmitry_Kalianchuk Date: Tue, 30 Sep 2025 12:36:40 +0200 Subject: [PATCH 1/4] GithubActions added --- .github/workflows/cv-build-test.yml | 84 +++++++++++ .github/workflows/cv-release.yml | 213 ++++++++++++++++++++++++++++ GITHUB_ACTIONS.md | 212 +++++++++++++++++++++++++++ 3 files changed, 509 insertions(+) create mode 100644 .github/workflows/cv-build-test.yml create mode 100644 .github/workflows/cv-release.yml create mode 100644 GITHUB_ACTIONS.md diff --git a/.github/workflows/cv-build-test.yml b/.github/workflows/cv-build-test.yml new file mode 100644 index 0000000..97fab2d --- /dev/null +++ b/.github/workflows/cv-build-test.yml @@ -0,0 +1,84 @@ +name: Build and Test CV + +on: + # Trigger on pull requests + pull_request: + branches: [ main, master ] + paths: + - 'content/**' + - 'template/**' + - 'pdf/**' + - 'build_html.sh' + - 'Makefile' + + # Trigger on pushes to main/master (without creating release) + push: + branches: [ main, master ] + paths: + - 'content/**' + - 'template/**' + - 'pdf/**' + - 'build_html.sh' + - 'Makefile' + +jobs: + test-build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Make scripts executable + run: | + chmod +x build_html.sh + chmod +x docker/scripts/build.sh + chmod +x docker/scripts/generate.sh + + - name: Build Docker image + run: | + echo "🔄 Building Docker image..." + make image + + - name: Test CV generation using Docker + run: | + echo "🔄 Testing CV generation with Docker..." + make pdf + + - name: Validate file sizes + run: | + echo "📊 Generated file information:" + + HTML_SIZE=$(stat -c%s "dist/cv.html") + PDF_SIZE=$(stat -c%s "dist/cv.pdf") + + echo "HTML size: $(numfmt --to=iec $HTML_SIZE) ($HTML_SIZE bytes)" + echo "PDF size: $(numfmt --to=iec $PDF_SIZE) ($PDF_SIZE bytes)" + + # Basic validation - files should be larger than 1KB + if [ $HTML_SIZE -lt 1024 ]; then + echo "❌ Warning: HTML file seems too small" + exit 1 + fi + + if [ $PDF_SIZE -lt 5120 ]; then + echo "❌ Warning: PDF file seems too small" + exit 1 + fi + + echo "✅ File sizes look good" + + - name: Upload build artifacts (for review) + uses: actions/upload-artifact@v4 + with: + name: cv-build-test + path: | + dist/cv.html + dist/cv.pdf + retention-days: 7 + + - name: Display success message + run: | + echo "🎉 CV build and test completed successfully!" + echo "📁 Generated files are available as artifacts" + echo "🔍 You can download them from the Actions run page to review" \ No newline at end of file diff --git a/.github/workflows/cv-release.yml b/.github/workflows/cv-release.yml new file mode 100644 index 0000000..feac920 --- /dev/null +++ b/.github/workflows/cv-release.yml @@ -0,0 +1,213 @@ +name: Generate CV and Create Release + +on: + # Trigger on git tags (for versioned releases) + push: + tags: + - 'v*' + - 'release-*' + + # Manual trigger from GitHub UI + workflow_dispatch: + inputs: + release_name: + description: 'Release name (optional)' + required: false + default: '' + prerelease: + description: 'Mark as pre-release' + required: false + default: false + type: boolean + + # Trigger on changes to CV content (optional - uncomment if desired) + # push: + # branches: [ main, master ] + # paths: + # - 'content/**' + # - 'template/**' + +jobs: + generate-cv: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Make scripts executable + run: | + chmod +x build_html.sh + chmod +x docker/scripts/build.sh + chmod +x docker/scripts/generate.sh + + - name: Build Docker image + run: make image + + - name: Generate CV using Docker + run: make pdf + + - name: Verify generated files + run: | + echo "Checking generated files..." + ls -la dist/ + + if [ ! -f "dist/cv.html" ]; then + echo "❌ Error: cv.html not found" + exit 1 + fi + + if [ ! -f "dist/cv.pdf" ]; then + echo "❌ Error: cv.pdf not found" + exit 1 + fi + + echo "✅ Both HTML and PDF files generated successfully" + + - name: Get file sizes and info + run: | + echo "Generated files:" + echo "HTML: $(ls -lh dist/cv.html | awk '{print $5}')" + echo "PDF: $(ls -lh dist/cv.pdf | awk '{print $5}')" + + - name: Prepare release assets + run: | + # Create a release directory + mkdir -p release + + # Copy files with descriptive names + cp dist/cv.html "release/CV-$(date +%Y%m%d).html" + cp dist/cv.pdf "release/CV-$(date +%Y%m%d).pdf" + + # Also keep original names for consistency + cp dist/cv.html release/ + cp dist/cv.pdf release/ + + echo "Release assets prepared:" + ls -la release/ + + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: cv-files + path: | + release/ + dist/ + retention-days: 30 + + - name: Determine release info + id: release_info + run: | + # Set release name + if [ "${{ github.event.inputs.release_name }}" != "" ]; then + RELEASE_NAME="${{ github.event.inputs.release_name }}" + elif [ "${{ github.ref_type }}" == "tag" ]; then + RELEASE_NAME="${{ github.ref_name }}" + else + RELEASE_NAME="CV Release $(date +%Y-%m-%d)" + fi + + echo "release_name=$RELEASE_NAME" >> $GITHUB_OUTPUT + + # Set tag name (create one if triggered manually) + if [ "${{ github.ref_type }}" == "tag" ]; then + TAG_NAME="${{ github.ref_name }}" + else + TAG_NAME="cv-$(date +%Y%m%d-%H%M%S)" + fi + + echo "tag_name=$TAG_NAME" >> $GITHUB_OUTPUT + + # Set prerelease flag + PRERELEASE="false" + if [ "${{ github.event.inputs.prerelease }}" == "true" ]; then + PRERELEASE="true" + fi + + echo "prerelease=$PRERELEASE" >> $GITHUB_OUTPUT + + echo "Release will be created with:" + echo " Name: $RELEASE_NAME" + echo " Tag: $TAG_NAME" + echo " Prerelease: $PRERELEASE" + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ steps.release_info.outputs.tag_name }} + release_name: ${{ steps.release_info.outputs.release_name }} + draft: false + prerelease: ${{ steps.release_info.outputs.prerelease }} + body: | + ## CV Files Generated 📄 + + This release contains the latest version of the CV in both HTML and PDF formats. + + ### 📁 Files Included: + - **CV.pdf** - PDF version with preserved styling and backgrounds + - **CV.html** - Web version for online viewing + - **CV-YYYYMMDD.pdf** - Dated PDF version + - **CV-YYYYMMDD.html** - Dated HTML version + + ### 🎨 Features: + - Professional VS Code dark theme aesthetic + - Print-optimized A4 formatting + - Background colors and styling preserved in PDF + - Responsive design for all devices + + ### 🔄 Generated on: $(date) + + Generated automatically from the latest CV content using GitHub Actions. + + - name: Upload PDF Release Asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./dist/cv.pdf + asset_name: CV.pdf + asset_content_type: application/pdf + + - name: Upload HTML Release Asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./dist/cv.html + asset_name: CV.html + asset_content_type: text/html + + - name: Upload Dated PDF Asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./release/CV-$(date +%Y%m%d).pdf + asset_name: CV-$(date +%Y%m%d).pdf + asset_content_type: application/pdf + + - name: Upload Dated HTML Asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./release/CV-$(date +%Y%m%d).html + asset_name: CV-$(date +%Y%m%d).html + asset_content_type: text/html + + - name: Display release info + run: | + echo "🎉 Release created successfully!" + echo "📎 Release URL: ${{ steps.create_release.outputs.html_url }}" + echo "🔗 You can download the CV files from the release page" + echo "" + echo "📁 Direct download links:" + echo " PDF: ${{ steps.create_release.outputs.html_url }}/download/CV.pdf" + echo " HTML: ${{ steps.create_release.outputs.html_url }}/download/CV.html" \ No newline at end of file diff --git a/GITHUB_ACTIONS.md b/GITHUB_ACTIONS.md new file mode 100644 index 0000000..7e5ece8 --- /dev/null +++ b/GITHUB_ACTIONS.md @@ -0,0 +1,212 @@ +# GitHub Actions CI/CD for CV Generator + +This repository now includes automated CV generation and release publishing using GitHub Actions. The workflows will automatically build your CV in both HTML and PDF formats and make them available for download. + +## 🔄 Available Workflows + +### 1. CV Release Workflow (`cv-release.yml`) + +**Purpose**: Generates CV files and creates a GitHub release with downloadable assets. + +**Triggers**: +- **Git Tags**: Push a tag starting with `v` or `release-` (e.g., `v1.0`, `release-2024-01`) +- **Manual Trigger**: Run from GitHub Actions tab with custom options +- **Content Changes** (optional): Uncomment the push trigger to auto-release on content updates + +**Generated Assets**: +- `CV.pdf` - Latest PDF version +- `CV.html` - Latest HTML version +- `CV-YYYYMMDD.pdf` - Dated PDF version +- `CV-YYYYMMDD.html` - Dated HTML version + +### 2. Build Test Workflow (`cv-build-test.yml`) + +**Purpose**: Tests CV generation on pull requests and content changes without creating releases. + +**Triggers**: +- Pull requests affecting CV content or templates +- Pushes to main/master branch affecting CV files + +**Outputs**: +- Build artifacts available for download from Actions tab +- Validation of HTML and PDF generation + +## 🚀 How to Use + +### Creating a Release (Method 1: Git Tags) + +1. **Create and push a tag**: + ```bash + git tag v1.0 + git push origin v1.0 + ``` + +2. **The workflow will automatically**: + - Build HTML and PDF versions + - Create a GitHub release + - Upload files as downloadable assets + +3. **Access your CV**: + - Go to the "Releases" section of your repository + - Download the PDF or HTML files + - Share the direct download links + +### Creating a Release (Method 2: Manual Trigger) + +1. **Go to GitHub Actions tab** in your repository +2. **Select "Generate CV and Create Release"** +3. **Click "Run workflow"** +4. **Configure options** (optional): + - Custom release name + - Mark as pre-release +5. **Click "Run workflow"** to start + +### Testing Changes + +- **Pull Requests**: Automatically tested when you open a PR +- **Content Updates**: Automatically tested when you push to main/master +- **Manual Testing**: Run the "Build and Test CV" workflow manually + +## 📁 File Access + +### Direct Download Links + +Once a release is created, you can access files via direct links: + +``` +https://github.com/USERNAME/REPOSITORY/releases/latest/download/CV.pdf +https://github.com/USERNAME/REPOSITORY/releases/latest/download/CV.html +``` + +Replace `USERNAME` and `REPOSITORY` with your GitHub username and repository name. + +### Release Page + +Visit the releases page for a complete overview: +``` +https://github.com/USERNAME/REPOSITORY/releases +``` + +## 🔧 Configuration + +### Customizing Triggers + +You can modify the workflow triggers in `.github/workflows/cv-release.yml`: + +**Enable automatic releases on content changes**: +```yaml +# Uncomment these lines in cv-release.yml +push: + branches: [ main, master ] + paths: + - 'content/**' + - 'template/**' +``` + +**Change tag patterns**: +```yaml +push: + tags: + - 'v*' # Tags like v1.0, v2.1 + - 'release-*' # Tags like release-2024-01 + - 'cv-*' # Tags like cv-latest +``` + +### Customizing Release Content + +Edit the release body in the workflow file to change the description format. + +### Adding Dependencies + +If you add new Node.js dependencies, update `package.json` and the workflow will automatically install them. + +## 🛠️ Troubleshooting + +### Common Issues + +1. **Workflow fails with "Pandoc not found"** + - The workflow installs Pandoc automatically + - Check the workflow logs for installation errors + +2. **PDF generation fails** + - Ensure your HTML generates successfully first + - Check for any CSS or content issues + +3. **Release creation fails** + - Ensure you have the `GITHUB_TOKEN` permissions + - Check if tag already exists + +4. **Files are empty or too small** + - The workflow validates file sizes + - Check your content files for issues + +### Viewing Logs + +1. Go to **Actions** tab in your repository +2. Click on the failed workflow run +3. Expand the failed step to see detailed logs + +### Manual Testing + +Test locally before pushing: +```bash +# Test HTML generation +./build_html.sh + +# Test PDF generation +npm install +node pdf/generate-pdf.js + +# Check generated files +ls -la dist/ +``` + +## 📊 Workflow Features + +### Security +- Uses official GitHub Actions +- Minimal required permissions +- No external services required + +### Performance +- Caches Node.js dependencies +- Parallel artifact uploads +- Efficient file handling + +### Reliability +- File validation steps +- Error handling and reporting +- Comprehensive logging + +### Flexibility +- Multiple trigger options +- Customizable release naming +- Optional pre-release marking + +## 🎯 Best Practices + +1. **Use semantic versioning** for tags: `v1.0.0`, `v1.1.0`, etc. +2. **Test changes** using pull requests before merging +3. **Keep content files focused** on their specific sections +4. **Use descriptive commit messages** for better release notes +5. **Review generated files** by downloading artifacts from test runs + +## 🔗 Integration Tips + +### Sharing Your CV + +- **Direct PDF link**: Share the latest download URL +- **Portfolio website**: Embed the HTML version or link to releases +- **Email applications**: Attach the downloaded PDF +- **LinkedIn**: Link to your latest release + +### Automation Ideas + +- **Scheduled updates**: Add cron triggers for periodic releases +- **Slack notifications**: Add webhook notifications for new releases +- **Multiple formats**: Extend to generate DOCX or other formats +- **Multi-language**: Create separate workflows for different languages + +--- + +Your CV is now automatically built and published! 🎉 \ No newline at end of file From 3634fa8c40cf047080970780fd2e39f1619549d2 Mon Sep 17 00:00:00 2001 From: Dzmitry_Kalianchuk Date: Tue, 30 Sep 2025 13:01:37 +0200 Subject: [PATCH 2/4] Updated workflows to reflect latest changes --- .github/workflows/cv-build-test.yml | 4 +- .github/workflows/cv-release.yml | 72 +++++------------------------ 2 files changed, 14 insertions(+), 62 deletions(-) diff --git a/.github/workflows/cv-build-test.yml b/.github/workflows/cv-build-test.yml index 97fab2d..b651a87 100644 --- a/.github/workflows/cv-build-test.yml +++ b/.github/workflows/cv-build-test.yml @@ -50,7 +50,7 @@ jobs: echo "📊 Generated file information:" HTML_SIZE=$(stat -c%s "dist/cv.html") - PDF_SIZE=$(stat -c%s "dist/cv.pdf") + PDF_SIZE=$(stat -c%s "dist/dzmitry_kalianchuk_cv.pdf") echo "HTML size: $(numfmt --to=iec $HTML_SIZE) ($HTML_SIZE bytes)" echo "PDF size: $(numfmt --to=iec $PDF_SIZE) ($PDF_SIZE bytes)" @@ -74,7 +74,7 @@ jobs: name: cv-build-test path: | dist/cv.html - dist/cv.pdf + dist/dzmitry_kalianchuk_cv.pdf retention-days: 7 - name: Display success message diff --git a/.github/workflows/cv-release.yml b/.github/workflows/cv-release.yml index feac920..8693550 100644 --- a/.github/workflows/cv-release.yml +++ b/.github/workflows/cv-release.yml @@ -57,8 +57,8 @@ jobs: exit 1 fi - if [ ! -f "dist/cv.pdf" ]; then - echo "❌ Error: cv.pdf not found" + if [ ! -f "dist/dzmitry_kalianchuk_cv.pdf" ]; then + echo "❌ Error: dzmitry_kalianchuk_cv.pdf not found" exit 1 fi @@ -68,7 +68,7 @@ jobs: run: | echo "Generated files:" echo "HTML: $(ls -lh dist/cv.html | awk '{print $5}')" - echo "PDF: $(ls -lh dist/cv.pdf | awk '{print $5}')" + echo "PDF: $(ls -lh dist/dzmitry_kalianchuk_cv.pdf | awk '{print $5}')" - name: Prepare release assets run: | @@ -77,11 +77,12 @@ jobs: # Copy files with descriptive names cp dist/cv.html "release/CV-$(date +%Y%m%d).html" - cp dist/cv.pdf "release/CV-$(date +%Y%m%d).pdf" + cp dist/dzmitry_kalianchuk_cv.pdf "release/CV-$(date +%Y%m%d).pdf" # Also keep original names for consistency cp dist/cv.html release/ - cp dist/cv.pdf release/ + cp dist/dzmitry_kalianchuk_cv.pdf release/cv.pdf + cp dist/dzmitry_kalianchuk_cv.pdf release/dzmitry_kalianchuk_cv.pdf echo "Release assets prepared:" ls -la release/ @@ -142,25 +143,7 @@ jobs: draft: false prerelease: ${{ steps.release_info.outputs.prerelease }} body: | - ## CV Files Generated 📄 - - This release contains the latest version of the CV in both HTML and PDF formats. - - ### 📁 Files Included: - - **CV.pdf** - PDF version with preserved styling and backgrounds - - **CV.html** - Web version for online viewing - - **CV-YYYYMMDD.pdf** - Dated PDF version - - **CV-YYYYMMDD.html** - Dated HTML version - - ### 🎨 Features: - - Professional VS Code dark theme aesthetic - - Print-optimized A4 formatting - - Background colors and styling preserved in PDF - - Responsive design for all devices - - ### 🔄 Generated on: $(date) - - Generated automatically from the latest CV content using GitHub Actions. + CV generated on: $(date +"%Y-%m-%d %H:%M:%S UTC") - name: Upload PDF Release Asset uses: actions/upload-release-asset@v1 @@ -168,46 +151,15 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./dist/cv.pdf - asset_name: CV.pdf - asset_content_type: application/pdf - - - name: Upload HTML Release Asset - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./dist/cv.html - asset_name: CV.html - asset_content_type: text/html - - - name: Upload Dated PDF Asset - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./release/CV-$(date +%Y%m%d).pdf - asset_name: CV-$(date +%Y%m%d).pdf + asset_path: ./dist/dzmitry_kalianchuk_cv.pdf + asset_name: dzmitry_kalianchuk_cv.pdf asset_content_type: application/pdf - - name: Upload Dated HTML Asset - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./release/CV-$(date +%Y%m%d).html - asset_name: CV-$(date +%Y%m%d).html - asset_content_type: text/html - - name: Display release info run: | echo "🎉 Release created successfully!" echo "📎 Release URL: ${{ steps.create_release.outputs.html_url }}" - echo "🔗 You can download the CV files from the release page" + echo "🔗 You can download the CV from the release page" echo "" - echo "📁 Direct download links:" - echo " PDF: ${{ steps.create_release.outputs.html_url }}/download/CV.pdf" - echo " HTML: ${{ steps.create_release.outputs.html_url }}/download/CV.html" \ No newline at end of file + echo "📁 Direct download link:" + echo " PDF: ${{ steps.create_release.outputs.html_url }}/download/dzmitry_kalianchuk_cv.pdf" \ No newline at end of file From 1364bef2e6f6262af3a375f80628ba55d71f5534 Mon Sep 17 00:00:00 2001 From: Dzmitry_Kalianchuk Date: Tue, 30 Sep 2025 13:07:02 +0200 Subject: [PATCH 3/4] Run on any changes --- .github/workflows/cv-build-test.yml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/.github/workflows/cv-build-test.yml b/.github/workflows/cv-build-test.yml index b651a87..4135598 100644 --- a/.github/workflows/cv-build-test.yml +++ b/.github/workflows/cv-build-test.yml @@ -4,22 +4,10 @@ on: # Trigger on pull requests pull_request: branches: [ main, master ] - paths: - - 'content/**' - - 'template/**' - - 'pdf/**' - - 'build_html.sh' - - 'Makefile' # Trigger on pushes to main/master (without creating release) push: branches: [ main, master ] - paths: - - 'content/**' - - 'template/**' - - 'pdf/**' - - 'build_html.sh' - - 'Makefile' jobs: test-build: From 33e265707435584ba6a1f62045044e7b93ecff9d Mon Sep 17 00:00:00 2001 From: Dzmitry_Kalianchuk Date: Tue, 30 Sep 2025 13:09:48 +0200 Subject: [PATCH 4/4] Updated Documentation --- GITHUB_ACTIONS.md | 212 ---------------------------------------------- README.md | 31 ++++++- 2 files changed, 30 insertions(+), 213 deletions(-) delete mode 100644 GITHUB_ACTIONS.md diff --git a/GITHUB_ACTIONS.md b/GITHUB_ACTIONS.md deleted file mode 100644 index 7e5ece8..0000000 --- a/GITHUB_ACTIONS.md +++ /dev/null @@ -1,212 +0,0 @@ -# GitHub Actions CI/CD for CV Generator - -This repository now includes automated CV generation and release publishing using GitHub Actions. The workflows will automatically build your CV in both HTML and PDF formats and make them available for download. - -## 🔄 Available Workflows - -### 1. CV Release Workflow (`cv-release.yml`) - -**Purpose**: Generates CV files and creates a GitHub release with downloadable assets. - -**Triggers**: -- **Git Tags**: Push a tag starting with `v` or `release-` (e.g., `v1.0`, `release-2024-01`) -- **Manual Trigger**: Run from GitHub Actions tab with custom options -- **Content Changes** (optional): Uncomment the push trigger to auto-release on content updates - -**Generated Assets**: -- `CV.pdf` - Latest PDF version -- `CV.html` - Latest HTML version -- `CV-YYYYMMDD.pdf` - Dated PDF version -- `CV-YYYYMMDD.html` - Dated HTML version - -### 2. Build Test Workflow (`cv-build-test.yml`) - -**Purpose**: Tests CV generation on pull requests and content changes without creating releases. - -**Triggers**: -- Pull requests affecting CV content or templates -- Pushes to main/master branch affecting CV files - -**Outputs**: -- Build artifacts available for download from Actions tab -- Validation of HTML and PDF generation - -## 🚀 How to Use - -### Creating a Release (Method 1: Git Tags) - -1. **Create and push a tag**: - ```bash - git tag v1.0 - git push origin v1.0 - ``` - -2. **The workflow will automatically**: - - Build HTML and PDF versions - - Create a GitHub release - - Upload files as downloadable assets - -3. **Access your CV**: - - Go to the "Releases" section of your repository - - Download the PDF or HTML files - - Share the direct download links - -### Creating a Release (Method 2: Manual Trigger) - -1. **Go to GitHub Actions tab** in your repository -2. **Select "Generate CV and Create Release"** -3. **Click "Run workflow"** -4. **Configure options** (optional): - - Custom release name - - Mark as pre-release -5. **Click "Run workflow"** to start - -### Testing Changes - -- **Pull Requests**: Automatically tested when you open a PR -- **Content Updates**: Automatically tested when you push to main/master -- **Manual Testing**: Run the "Build and Test CV" workflow manually - -## 📁 File Access - -### Direct Download Links - -Once a release is created, you can access files via direct links: - -``` -https://github.com/USERNAME/REPOSITORY/releases/latest/download/CV.pdf -https://github.com/USERNAME/REPOSITORY/releases/latest/download/CV.html -``` - -Replace `USERNAME` and `REPOSITORY` with your GitHub username and repository name. - -### Release Page - -Visit the releases page for a complete overview: -``` -https://github.com/USERNAME/REPOSITORY/releases -``` - -## 🔧 Configuration - -### Customizing Triggers - -You can modify the workflow triggers in `.github/workflows/cv-release.yml`: - -**Enable automatic releases on content changes**: -```yaml -# Uncomment these lines in cv-release.yml -push: - branches: [ main, master ] - paths: - - 'content/**' - - 'template/**' -``` - -**Change tag patterns**: -```yaml -push: - tags: - - 'v*' # Tags like v1.0, v2.1 - - 'release-*' # Tags like release-2024-01 - - 'cv-*' # Tags like cv-latest -``` - -### Customizing Release Content - -Edit the release body in the workflow file to change the description format. - -### Adding Dependencies - -If you add new Node.js dependencies, update `package.json` and the workflow will automatically install them. - -## 🛠️ Troubleshooting - -### Common Issues - -1. **Workflow fails with "Pandoc not found"** - - The workflow installs Pandoc automatically - - Check the workflow logs for installation errors - -2. **PDF generation fails** - - Ensure your HTML generates successfully first - - Check for any CSS or content issues - -3. **Release creation fails** - - Ensure you have the `GITHUB_TOKEN` permissions - - Check if tag already exists - -4. **Files are empty or too small** - - The workflow validates file sizes - - Check your content files for issues - -### Viewing Logs - -1. Go to **Actions** tab in your repository -2. Click on the failed workflow run -3. Expand the failed step to see detailed logs - -### Manual Testing - -Test locally before pushing: -```bash -# Test HTML generation -./build_html.sh - -# Test PDF generation -npm install -node pdf/generate-pdf.js - -# Check generated files -ls -la dist/ -``` - -## 📊 Workflow Features - -### Security -- Uses official GitHub Actions -- Minimal required permissions -- No external services required - -### Performance -- Caches Node.js dependencies -- Parallel artifact uploads -- Efficient file handling - -### Reliability -- File validation steps -- Error handling and reporting -- Comprehensive logging - -### Flexibility -- Multiple trigger options -- Customizable release naming -- Optional pre-release marking - -## 🎯 Best Practices - -1. **Use semantic versioning** for tags: `v1.0.0`, `v1.1.0`, etc. -2. **Test changes** using pull requests before merging -3. **Keep content files focused** on their specific sections -4. **Use descriptive commit messages** for better release notes -5. **Review generated files** by downloading artifacts from test runs - -## 🔗 Integration Tips - -### Sharing Your CV - -- **Direct PDF link**: Share the latest download URL -- **Portfolio website**: Embed the HTML version or link to releases -- **Email applications**: Attach the downloaded PDF -- **LinkedIn**: Link to your latest release - -### Automation Ideas - -- **Scheduled updates**: Add cron triggers for periodic releases -- **Slack notifications**: Add webhook notifications for new releases -- **Multiple formats**: Extend to generate DOCX or other formats -- **Multi-language**: Create separate workflows for different languages - ---- - -Your CV is now automatically built and published! 🎉 \ No newline at end of file diff --git a/README.md b/README.md index 6320629..2109ade 100644 --- a/README.md +++ b/README.md @@ -136,7 +136,36 @@ node pdf/generate-pdf.js - **Web preview**: Open `dist/cv.html` in any modern browser - **Print preview**: Use browser's print function (Ctrl+P/Cmd+P) for A4 PDF layout -- **Direct PDF**: Generated files are saved in `dist/` directory## Maintenance Guide +- **Direct PDF**: Generated files are saved in `dist/` directory + +## GitHub Actions Automation + +This repository includes automated CV generation and release publishing using GitHub Actions. + +### Creating Releases + +**Method 1: Git Tags (Recommended)** +```bash +git tag v1.0 +git push origin v1.0 +``` + +**Method 2: Manual Trigger** +1. Go to **Actions** tab in your repository +2. Select "Generate CV and Create Release" +3. Click "Run workflow" + +### What You Get + +- **Automatic PDF generation** using your Docker setup +- **GitHub release** with downloadable `dzmitry_kalianchuk_cv.pdf` +- **Direct download link**: `https://github.com/USER/REPO/releases/latest/download/dzmitry_kalianchuk_cv.pdf` + +### Testing + +- **Pull requests** automatically test CV generation +- **All pushes** to main/master trigger build validation +- **Build artifacts** available for download from Actions tab## Maintenance Guide ### Updating Content