Adressed some of Ludvig's comments #46
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 documents | |
on: [push] | |
jobs: | |
build_latex: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Git repository | |
uses: actions/checkout@v1 | |
- name: Compile statutes | |
uses: xu-cheng/latex-action@master | |
with: | |
root_file: statutes.tex | |
args: -pdf -file-line-error -synctex=1 -interaction=nonstopmode -file-line-error -recorder -f | |
continue-on-error: true | |
- name: Print statutes LaTeX log | |
shell: bash | |
if: failure() || success() | |
run: | | |
value=`cat statutes.log` | |
echo "$value" | |
- name: Compile house rules | |
uses: xu-cheng/latex-action@master | |
with: | |
root_file: houseRules.tex | |
args: -pdf -file-line-error -synctex=1 -interaction=nonstopmode -file-line-error -recorder -f | |
continue-on-error: true | |
- name: Print house rules LaTeX log | |
shell: bash | |
if: failure() || success() | |
run: | | |
value=`cat houseRules.log` | |
echo "$value" | |
- name: Copy to output directory | |
shell: bash | |
if: failure() || success() | |
run: | | |
mkdir built | |
mv statutes.pdf built/statutes.pdf | |
mv houseRules.pdf built/houseRules.pdf | |
- name: Upload PDFs | |
uses: actions/upload-artifact@v1.0.0 | |
with: | |
# Artifact name | |
name: Built Statutes | |
# Directory containing files to upload | |
path: ./built | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1.0.0 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Auto-built draft from ${{ github.ref }} | |
draft: true | |
prerelease: true | |
- name: Get current time | |
uses: srfrnk/current-time@master | |
id: current-time | |
with: | |
format: YYYY-MM-DD | |
- name: Use current time | |
env: | |
TIME: "${{ steps.current-time.outputs.time }}" | |
F_TIME: "${{ steps.current-time.outputs.formattedTime }}" | |
run: echo $TIME $F_TIME | |
- name: Upload Statutes To Release | |
id: upload-statutes-asset | |
uses: actions/upload-release-asset@v1.0.1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./built/statutes.pdf | |
asset_name: statutes-${{ github.ref }}-${{ steps.current-time.outputs.formattedTime }}.pdf | |
asset_content_type: application/pdf | |
- name: Upload House Rules To Release | |
id: upload-houseRules-asset | |
uses: actions/upload-release-asset@v1.0.1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./built/houseRules.pdf | |
asset_name: houseRules-${{ github.ref }}-${{ steps.current-time.outputs.formattedTime }}.pdf | |
asset_content_type: application/pdf | |
- name: Create commit comment | |
uses: peter-evans/commit-comment@v1.0.1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
body: | | |
The statutes and house rules were automatically built by a :robot: in the :cloud:! | |
They can be downloaded at | |
${{ steps.upload-statutes-asset.outputs.browser_download_url }} | |
and | |
${{ steps.upload-houseRules-asset.outputs.browser_download_url }} | |
for users with push access to this repository :100:! |