Publish CV #3
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: "Publish CV" | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- "v[0-9]+.[0-9]+.[0-9]+" | |
env: | |
ARTIFACTS_DIR: ./github-artifacts | |
TEX_FILE: farhood-etaati-cv.tex | |
PDF_FILE: farhood-etaati-cv.pdf | |
jobs: | |
build-latex: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Git repository | |
uses: actions/checkout@v3 | |
- name: Compile LaTeX document | |
uses: xu-cheng/latex-action@v3 | |
with: | |
root_file: $TEX_FILE | |
- name: move | |
run: mkdir -p github_artifacts && mv ${{ env.PDF_FILE }} ${{ env.ARTIFACTS_DIR }} | |
- name: Upload PDF file | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ env.PDF_FILE }} | |
path: ${{ env.ARTIFACTS_DIR }} | |
deploy: | |
runs-on: ubuntu-latest | |
needs: [build-latex] | |
env: | |
GITHUB_PAGES_DIR: ./github_pages | |
steps: | |
- name: Checkout | |
uses: actions/checkout@master | |
- name: Download artifact | |
uses: actions/download-artifact@v3 | |
with: | |
path: ${{ env.ARTIFACTS_DIR }} | |
- name: Move to pages directory | |
run: mv ${{ env.ARTIFACTS_DIR }} ${{ env.GITHUB_PAGES_DIR }} | |
- name: deploy on orphan branch | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ${{ env.GITHUB_PAGES_DIR }} | |
publish_branch: build | |
force_orphan: true | |
enable_jekyll: true | |
copy-index-to-build: | |
needs: [deploy] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Copy To Branches Action | |
uses: planetoftheweb/[email protected] | |
env: | |
key: main | |
files: index.html CNAME | |