Files
morten-olsen.github.io/.github/workflows/build-latex.yml
Morten Olsen 337cc4e71b updates
2021-08-27 21:02:36 +02:00

100 lines
3.3 KiB
YAML

name: CI/CD
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Compile LaTeX document
uses: xu-cheng/latex-action@v2
with:
root_file: |
a4.tex
a5.tex
a6.tex
working_directory: latex
latexmk_use_lualatex: true
- uses: actions/upload-artifact@v2
with:
name: pdfs
path: latex/*.pdf
update-readme:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '12'
- name: Build READM.md
run: node scripts/update-readme.js > README.md
- uses: EndBug/add-and-commit@v7
with:
add: README.md
author_name: Git Actions
author_email: gitactions@example.com
message: Updated README.md
release:
needs: [build]
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v2
with:
name: pdfs
- name: Display structure of downloaded files
run: ls -R
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v1.${{ github.run_id }}
release_name: Release v1.${{ github.run_id }}
draft: false
prerelease: false
- name: Upload A4 Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./a4.pdf
asset_name: a4.pdf
asset_content_type: application/pdf
- name: Upload A5 Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./a5.pdf
asset_name: a5.pdf
asset_content_type: application/pdf
- name: Upload A6 Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./a6.pdf
asset_name: a6.pdf
asset_content_type: application/pdf