diff --git a/.github/workflows/build-pdf.yml b/.github/workflows/build-pdf.yml new file mode 100644 index 0000000..7fed830 --- /dev/null +++ b/.github/workflows/build-pdf.yml @@ -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/cool-github-releases@v1.1.2 + 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 }} diff --git a/README.md b/README.md new file mode 100644 index 0000000..206df91 --- /dev/null +++ b/README.md @@ -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. \ No newline at end of file