Skip to content

update-cv

update-cv #666

Workflow file for this run

name: update-cv
on:
workflow_dispatch: {}
schedule: [cron: '0 0 */1 * *']
push:
branches: [master, main]
paths: [cv/**, .github/workflows/update-cv.yml]
concurrency:
group: ${{ github.ref }}-cv
cancel-in-progress: true
jobs:
generate-pdf:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: peaceiris/actions-hugo@v3
with: {hugo-version: 0.101.0, extended: true}
- run: sudo apt update && sudo apt install ghostscript wkhtmltopdf # https://wkhtmltopdf.org/
- run: hugo --minify -d ./../4pdf
env: {HUGO_RELATIVEURLS: true, HUGO_GOOGLEANALYTICS: '', GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'}
working-directory: ./cv
- run: wkhtmltopdf --enable-local-file-access --lowquality ./4pdf/index.html ./cv-uncompressed.pdf
- run: |
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH \
-sOutputFile=./cv.pdf ./cv-uncompressed.pdf
- uses: actions/upload-artifact@v4
with: {name: cv-en.pdf, path: ./cv.pdf, retention-days: 1}
- run: rm -v ./cv-uncompressed.pdf ./cv.pdf
- run: wkhtmltopdf --enable-local-file-access --lowquality ./4pdf/ru/index.html ./cv-uncompressed.pdf
- run: |
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH \
-sOutputFile=./cv.pdf ./cv-uncompressed.pdf
- uses: actions/upload-artifact@v4
with: {name: cv-ru.pdf, path: ./cv.pdf, retention-days: 1}
update-cv-page:
runs-on: ubuntu-latest
needs: [generate-pdf]
steps:
- uses: actions/checkout@v4
- uses: peaceiris/actions-hugo@v3
with: {hugo-version: 0.101.0, extended: true}
- run: hugo --minify --baseURL "https://cv.tarampamp.am/" -d ./dist
env: {GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'}
working-directory: ./cv
- uses: actions/download-artifact@v4
with: {name: cv-en.pdf, path: ./cv/dist}
- uses: actions/download-artifact@v4
with: {name: cv-ru.pdf, path: ./cv/dist/ru}
- uses: cloudflare/pages-action@1
with:
apiToken: ${{ secrets.CLOUDFLARE_PAGES_DEPLOY_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: cv-tarampamp-am
directory: ./cv/dist
branch: main # aka CF "production" environment
gitHubToken: ${{ secrets.GITHUB_TOKEN }}