Auto Render CV #93
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
on: | |
push: | |
branches: master | |
schedule: | |
- cron: '0 0 * * MON,THU' | |
name: Auto Render CV | |
jobs: | |
render: | |
name: Render cv to PDF | |
runs-on: macOS-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: r-lib/actions/setup-r@v2 | |
- name: Install OpenSSL and create a symlink | |
run: | | |
brew install openssl@1.1 | |
ln -s /opt/homebrew/Cellar/openssl@1.1/1.1.1l_1 /opt/homebrew/opt/openssl | |
path+=("/opt/homebrew/opt/openssl@1.1/bin") | |
export LDFLAGS="-L/opt/homebrew/opt/openssl@1.1/lib" | |
export CPPFLAGS="-I/opt/homebrew/opt/openssl@1.1/include" | |
export PKG_CONFIG_PATH="/opt/homebrew/opt/openssl@1.1/lib/pkgconfig" | |
export LD_LIBRARY_PATH="/opt/homebrew/opt/openssl@1.1/lib" | |
shell: bash | |
- name: Install required packages | |
run: | | |
install.packages("openssl") | |
install.packages("rmarkdown") | |
install.packages("vitae") | |
shell: Rscript {0} | |
- uses: r-lib/actions/setup-renv@v2 | |
- uses: r-lib/actions/setup-pandoc@v2 | |
- name: Install tinytex | |
run: | | |
install.packages("tinytex") | |
tinytex::install_tinytex() | |
shell: Rscript {0} | |
- name: Render cv | |
env: | |
# set the SUPABASEUSER and SUPABASEPW secrets in the repository settings | |
SUPABASEUSER: ${{ secrets.SUPABASEUSER }} | |
SUPABASEPW: ${{ secrets.SUPABASEPW }} | |
UPDATEGOOGLESCHOLAR: ${{github.event_name == 'schedule'}} | |
run: Rscript -e 'rmarkdown::render("cv/cv.Rmd", output_format = "vitae::moderncv")' | |
- name: Generate release tag | |
id: generate_release_tag | |
uses: amitsingh-007/next-release-tag@v5.0.0 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
tag_prefix: 'v' | |
tag_template: 'yyyy-mm-dd-i' | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
make_latest: true | |
tag_name: ${{ steps.generate_release_tag.outputs.next_release_tag }} | |
body: "Automated release of cv.pdf" | |
files: | | |
cv/cv.pdf | |
# name: Commit results | |
# run: | | |
# git commit cv/cv.pdf -m 'Re-build cv.Rmd' || echo "No changes to commit" | |
# git push origin || echo "No changes to commit" |