Update 01_元智大學學生會選舉罷免法.txt #48
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: Generate PDF | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup node | |
uses: actions/setup-node@v1 | |
with: | |
node-version: '12.x' | |
- name: Setup LaTeX | |
run: sudo apt-get -qq update | |
- run: sudo apt-get -y --no-install-recommends install texlive-full | |
- name: Setup Fonts | |
run: sudo apt-get -y install xfonts-utils | |
- run: sudo mkdir -p /usr/share/fonts/truetype/ | |
- run: sudo cp fonts/* /usr/share/fonts/truetype/ | |
- run: sudo mkfontscale | |
- run: sudo mkfontdir | |
- run: sudo fc-cache -f | |
- name: Generate .tex document | |
run: node gen.js 1 | |
- name: Generate PDF File | |
run: seq 2 | xargs -I{} xelatex final.tex -interaction=nonstopmode -halt-on-error | |
- name: Create Release | |
id: create_release | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: v.${{ github.sha }} | |
release_name: Release ${{ github.sha }} | |
draft: false | |
prerelease: false | |
- name: Upload Release Asset | |
id: upload-release-asset | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./final.pdf | |
asset_name: statute.pdf | |
asset_content_type: application/pdf |