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
| name: Build resume PDF and deploy portfolio | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v6 | |
| - name: Compile ATS resume | |
| uses: xu-cheng/latex-action@v4 | |
| with: | |
| root_file: Tharuka-Chathura-Resume.tex | |
| working_directory: resume-source | |
| - name: Install PDF renderer | |
| shell: bash | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install --yes poppler-utils | |
| - name: Assemble GitHub Pages site | |
| shell: bash | |
| run: | | |
| mkdir -p _site | |
| rsync -a \ | |
| --exclude '.git/' \ | |
| --exclude '.github/' \ | |
| --exclude '_site/' \ | |
| --exclude 'resume-source/' \ | |
| ./ _site/ | |
| mkdir -p _site/assets | |
| cp resume-source/Tharuka-Chathura-Resume.pdf \ | |
| _site/assets/Tharuka-Chathura-Resume.pdf | |
| mkdir -p _site/assets/resume-pages | |
| pdftoppm -png -r 160 \ | |
| resume-source/Tharuka-Chathura-Resume.pdf \ | |
| _site/assets/resume-pages/page | |
| python3 -c 'import glob,json,re; pages=glob.glob("_site/assets/resume-pages/page-*.png"); pages.sort(key=lambda path: int(re.search(r"page-(\d+)\.png$", path).group(1))); print(json.dumps([path.removeprefix("_site/") for path in pages]))' \ | |
| > _site/assets/resume-pages/pages.json | |
| touch _site/.nojekyll | |
| - name: Configure GitHub Pages | |
| uses: actions/configure-pages@v5 | |
| - name: Upload Pages artifact | |
| uses: actions/upload-pages-artifact@v4 | |
| with: | |
| path: _site | |
| deploy: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |