build-resume-and-deploy #71
This file contains 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-and-deploy | |
on: | |
workflow_run: | |
workflows: ["semantic-release"] | |
types: | |
- completed | |
jobs: | |
create-html-files: | |
runs-on: ubuntu-latest | |
container: | |
image: asciidoctor/docker-asciidoctor | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Create ptbr(default) resume version | |
run: | | |
asciidoctor -o ./output/index.html -a toc=left -a docinfo=shared src/resume-ptbr.adoc | |
- name: Create en resume version | |
run: | | |
asciidoctor -o ./output/en/index.html -a toc=left -a docinfo=shared src/resume-en.adoc | |
- name: Send generated output files to cache | |
uses: actions/upload-artifact@v3 | |
with: | |
name: output | |
path: output | |
create-pdf-files: | |
runs-on: ubuntu-latest | |
container: | |
image: asciidoctor/docker-asciidoctor | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Create ptbr(default) resume version | |
run: | | |
asciidoctor-pdf -a allow-uri-read -a pdf-theme=src/resources/themes/default-theme.yml -a pdf-fontsdir=src/resources/fonts -o ./output/resume-raw.pdf src/resume-ptbr.adoc | |
- name: Create en resume version | |
run: | | |
asciidoctor-pdf -a allow-uri-read -a pdf-theme=src/resources/themes/default-theme.yml -a pdf-fontsdir=src/resources/fonts -o ./output/en/resume-raw.pdf src/resume-en.adoc | |
- name: Create ptbr(default) condensed resume version | |
run: | | |
asciidoctor-pdf -a with_activities=false -a allow-uri-read -a pdf-theme=src/resources/themes/default-theme.yml -a pdf-fontsdir=src/resources/fonts -o ./output/resume-condensed-raw.pdf src/resume-ptbr.adoc | |
- name: Create en condensed resume version | |
run: | | |
asciidoctor-pdf -a with_activities=false -a allow-uri-read -a pdf-theme=src/resources/themes/default-theme.yml -a pdf-fontsdir=src/resources/fonts -o ./output/en/resume-condensed-raw.pdf src/resume-en.adoc | |
- name: Send generated output files to cache | |
uses: actions/upload-artifact@v3 | |
with: | |
name: output | |
path: output | |
optimize-pdf: | |
runs-on: ubuntu-latest | |
needs: create-pdf-files | |
steps: | |
- name: Recover generated files from cache | |
uses: actions/download-artifact@v3 | |
with: | |
name: output | |
path: output | |
- name: Compress ptbr(dafault) version PDF | |
uses: jy95/ghostscript-action@v1 | |
with: | |
file: "output/resume-raw.pdf" | |
output: "output/resume.pdf" | |
arbitrary-parameters: "-sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dPrinted=false -dNOPAUSE -dQUIET -dBATCH" | |
- name: Compress ptbr(dafault) consensed version PDF | |
uses: jy95/ghostscript-action@v1 | |
with: | |
file: "output/resume-condensed-raw.pdf" | |
output: "output/resume-condensed.pdf" | |
arbitrary-parameters: "-sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dPrinted=false -dNOPAUSE -dQUIET -dBATCH" | |
- name: Compress english version PDF | |
uses: jy95/ghostscript-action@v1 | |
with: | |
file: "output/en/resume-raw.pdf" | |
output: "output/en/resume.pdf" | |
arbitrary-parameters: "-sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dPrinted=false -dNOPAUSE -dQUIET -dBATCH" | |
- name: Compress en consensed version PDF | |
uses: jy95/ghostscript-action@v1 | |
with: | |
file: "output/en/resume-condensed-raw.pdf" | |
output: "output/en/resume-condensed.pdf" | |
arbitrary-parameters: "-sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dPrinted=false -dNOPAUSE -dQUIET -dBATCH" | |
- name: Send generated output files to cache | |
uses: actions/upload-artifact@v3 | |
with: | |
name: output | |
path: output | |
publish-to-github-pages: | |
runs-on: ubuntu-latest | |
needs: | |
- create-html-files | |
- optimize-pdf | |
steps: | |
- name: Recover generated files from cache | |
uses: actions/download-artifact@v3 | |
with: | |
name: output | |
path: output | |
- name: Remove transient PDF version | |
run: rm output/resume-raw.pdf output/en/resume-raw.pdf ./output/resume-condensed-raw.pdf ./output/en/resume-condensed-raw.pdf | |
- name: Create CNAME file | |
run: echo ${{ secrets.GH_PAGES_DOMAIN }} > ./output/CNAME | |
- name: Deploy to github pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./output |