made use of main
branch to build cv using ci with CICV2P message (#30)
#28
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: CICV2P | |
on: | |
push: | |
branches: | |
- main | |
- 6-cv-jan-2021 | |
- 08-march2021 | |
- 10-oct2021 | |
- 12-cvmarch2022 | |
- 15-may2022 | |
- 15-minor-changes | |
- 18-june2022 | |
- 18-cv_june2022 | |
- 21-november2022 | |
- 23-feb2023 | |
- 25-march2023 | |
- 27-may2023 | |
- 27-minor-updates-may2023 | |
- 30-july2023 | |
- 30-20thjuly2023 | |
jobs: | |
build: | |
if: "contains(github.event.head_commit.message, 'CICV2P')" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Git repository | |
uses: actions/checkout@v3 | |
- name: Compile CV | |
uses: xu-cheng/latex-action@v2 | |
with: | |
root_file: cv-two-pages.tex | |
working_directory: tex | |
- name: Check pdf files | |
run: | | |
file tex/cv-two-pages.pdf | grep -q ' PDF ' | |
- name: Upload cv.pdf | |
run: | | |
# configure git | |
git config --global user.name "mxochicale" | |
git config --global user.email "[email protected]" | |
# setup ssh | |
mkdir ~/.ssh | |
chmod 700 ~/.ssh | |
echo "$DEPLOY_KEY" > ~/.ssh/id_ed25519 | |
chmod 600 ~/.ssh/id_ed25519 | |
git config --global core.sshCommand "ssh -i ~/.ssh/id_ed25519 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" | |
git clone --depth=1 --branch generated-pdfs [email protected]:mxochicale/cv.git "$GITHUB_WORKSPACE/deploy" | |
cp -f tex/cv-two-pages.pdf "$GITHUB_WORKSPACE/deploy/cv-two-pages.pdf" | |
cd "$GITHUB_WORKSPACE/deploy" | |
git add cv-two-pages.pdf | |
git commit -m github.event.head_commit.message | |
git push | |
env: | |
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }} |