Skip to content

Commit

Permalink
Merge pull request #2 from UCL-INGI/ghactions
Browse files Browse the repository at this point in the history
Small edits to merge #1
  • Loading branch information
qdeconinck authored May 25, 2020
2 parents a70dfa1 + 63c2ea6 commit 34ea38f
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/build-pdf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Build LaTeX document
# Trigger the workflow on push or pull request
on: [push, pull_request]
env:
FINAL_FILENAME: thesis_final.pdf
MAIN_LATEX: thesis.tex
DATE_TIMEZONE: Europe/Brussels

jobs:
build_latex:
runs-on: ubuntu-latest
steps:
- name: Set up Git repository
uses: actions/checkout@v2
- name: Extract filename from ${{ env.MAIN_LATEX }}
run: |
echo "::set-env name=MAIN_FILENAME::$(echo ${{ env.MAIN_LATEX }} | sed 's/\.[^.]*$//')"
- name: Compile LaTeX document
uses: xu-cheng/latex-action@v2
with:
root_file: ${{ env.MAIN_LATEX }}
- name: rename ${{ env.MAIN_FILENAME }}.pdf to ${{ env.FINAL_FILENAME }}
run: |
mv "${{ env.MAIN_FILENAME }}.pdf" "${{ env.FINAL_FILENAME }}"
- name: Upload result file
uses: actions/upload-artifact@v2
with:
name: ${{ env.FINAL_FILENAME }}
path: ${{ env.FINAL_FILENAME }}
release_latex:
runs-on: ubuntu-latest
needs: build_latex
if: github.ref == 'refs/heads/master'
steps:
- name: Checkout repository
uses: actions/checkout@v2
- uses: actions/download-artifact@v2
with:
name: ${{ env.FINAL_FILENAME }}
# See : https://github.com/actions/download-artifact/issues/14
- name: Restore permissions
run: |
chmod -R 777 ${{ env.FINAL_FILENAME }}
- name: Set timezone for date
run: |
sudo timedatectl set-timezone ${{ env.DATE_TIMEZONE }}
- name: Get current date
run: echo "::set-env name=CURRENT_DATETIME::$(date +'%d/%m/%Y %H:%M:%S')"
- name: Generate version number
run: echo "::set-env name=CURRENT_VERSION::$(date +'%d%m%Y_%H-%M-%S')"
- name: Upload result file into releases
uses: Xotl/[email protected]
with:
mode: update
tag_name: ${{ env.CURRENT_VERSION }}
release_name: PDF - ${{ env.CURRENT_DATETIME }}
replace_assets: true
assets: ${{ env.FINAL_FILENAME }}
initial_mrkdwn: Release auto-generated by Github Actions 🎉
github_token: ${{ github.token }}
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Template for EPL's UCLouvain Ph.D. Theses

This repository contains a template to write your thesis with the CIACO's requirements.
Just look at thesis.tex and start writing :-)

NB: For the bibliography, use Biber instead of BibTex.

## Continuous Integration with GitHub

If you use GitHub to host your repository, you can leverage the GitHub Actions to auto-generate the thesis PDF.
For this, you have a few environment variables to configure this workflow:

| env variable | purpose |
|---|---|
| **MAIN_LATEX** | The entry point of your thesis (here it is thesis.tex) |
| **FINAL_FILENAME** | The final name of the file, which follows the naming conventions of the UCLouvain (for example : Yakoub_13861700_2020.pdf ) |
| **DATE_TIMEZONE** | The timezone for release (by default, Github uses GMT timezone) |

Then in the Actions tab of your GitHub repository, you can build the thesis.

0 comments on commit 34ea38f

Please sign in to comment.