Build LaTeX and deploy on GitHub Releases #5
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 LaTeX and deploy on GitHub Releases | |
on: | |
push: | |
tags: '*' | |
branches-ignore: | |
- 'autodelivery**' | |
- 'bump-**' | |
- 'renovate/**' | |
paths-ignore: | |
- 'README.md' | |
- 'CHANGELOG.md' | |
- 'LICENSE' | |
- 'renovate.json' | |
schedule: | |
- cron: '0 0 * * 0' | |
pull_request: | |
workflow_dispatch: | |
permissions: { } | |
env: | |
PAPER_BASE_NAME: phd-thesis | |
jobs: | |
success: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 3.0 | |
- name: Install dependencies | |
run: | | |
gem install bibtex-ruby | |
- name: Generate bibliography | |
run: | | |
ruby bibtex_prettifier.rb | |
- name: Compile LaTeX | |
uses: xu-cheng/latex-action@v3 | |
with: | |
root_file: ${{ env.PAPER_BASE_NAME }}.tex | |
args: -pdf -file-line-error -halt-on-error -interaction=nonstopmode -shell-escape | |
- name: Bump version | |
id: bump-version | |
uses: anothrNick/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
DRY_RUN: true | |
- name: Get Time | |
id: current-time | |
run: echo "::set-output name=time::$(date +'%Y-%m-%dT%H%M%S')" | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: '${{ steps.bump-version.outputs.new_tag }}-${{ steps.current-time.outputs.time }}' | |
release_name: '${{ steps.bump-version.outputs.new_tag }}-${{ steps.current-time.outputs.time }}' | |
- name: Upload Release Asset | |
id: upload-release-asset-cv | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./${{ env.PAPER_BASE_NAME }}.pdf | |
asset_name: ${{ env.PAPER_BASE_NAME }}.pdf | |
asset_content_type: application/pdf |