fix: workflow #7
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: teebow1e - Build LaTeX CV | |
on: [push] | |
jobs: | |
build_cv: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
deployments: write | |
pages: write | |
id-token: write | |
steps: | |
- name: Set up Git repository | |
uses: actions/checkout@v4 | |
- name: Compile LaTeX CV | |
uses: xu-cheng/latex-action@v3 | |
with: | |
root_file: cv.tex | |
- name: Rename CV file | |
run: mv cv.pdf TrungTQT_CV.pdf | |
- name: Install pdf2htmlEX | |
run: | | |
sudo apt update | |
sudo apt install -y libfontconfig1 libcairo2 libjpeg-turbo8 | |
sudo apt --fix-broken install | |
wget https://github.com/pdf2htmlEX/pdf2htmlEX/releases/download/v0.18.8.rc1/pdf2htmlEX-0.18.8.rc1-master-20200630-Ubuntu-bionic-x86_64.deb | |
sudo mv pdf2htmlEX-0.18.8.rc1-master-20200630-Ubuntu-bionic-x86_64.deb pdf2htmlEX.deb | |
sudo dpkg -i ./pdf2htmlEX.deb | |
- name: Convert PDF to HTML | |
run: | | |
pdf2htmlEX --process-outline 1 --fallback 1 --bg-format svg --zoom 1.3 --process-type3 1 --dest-dir out TrungTQT_CV.pdf | |
ls -lavh out/ | |
mv out/TrungTQT_CV.html out/index.html | |
ls -lavh out/ | |
# (Optional) Create release | |
- name: Generate release tag | |
id: tag | |
run: | | |
sudo timedatectl set-timezone Asia/Ho_Chi_Minh | |
sudo date -s "$(wget -qSO- --max-redirect=0 google.com 2>&1 | grep Date: | cut -d' ' -f5-8)Z" | |
echo "release_tag=CV_Build_$(date +"%Y.%m.%d")" >> $GITHUB_OUTPUT | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ steps.tag.outputs.release_tag }} | |
files: | | |
./TrungTQT_CV.pdf | |
# (Optional) - Publish to Cloudflare site | |
- name: Publish | |
uses: cloudflare/pages-action@v1 | |
with: | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
projectName: 'cv' | |
directory: 'out' | |
permissions: | |
contents: write | |
pages: write | |
id-token: write |