Move docker build to external workflow #59
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: LaTeX Build and Upload | ||
on: [push, workflow_dispatch] | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
- name: Cache Docker layers | ||
uses: actions/cache@v3 | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-buildx-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-buildx- | ||
- name: Cache LaTeX packages | ||
uses: actions/cache@v3 | ||
with: | ||
path: /usr/local/texlive | ||
key: ${{ runner.os }}-texlive-${{ hashFiles('**/*.tex') }} | ||
restore-keys: | | ||
${{ runner.os }}-texlive- | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
# This step is replaced by pulling the image from GHCR | ||
- name: Pull Docker Image from GHCR | ||
run: docker pull ghcr.io/${{ github.repository_owner }}/latex-build:latest | ||
- name: Run Docker Container | ||
run: docker run -v $(pwd):/latex_content --name latex-container ghcr.io/${{ github.repository_owner }}/latex-build:latest /bin/sh -c "make pdf" | ||
- name: Copy PDF from Docker Container | ||
run: docker cp latex-container:/latex_content/rendered.pdf output.pdf | ||
- name: Upload PDF as Artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: compiled-pdf-${{ github. | ||
Check failure on line 48 in .github/workflows/github_action_build.yml GitHub Actions / LaTeX Build and UploadInvalid workflow file
|
||
path: output.pdf | ||
- name: Upload binaries to release | ||
uses: svenstaro/upload-release-action@v2 | ||
if: ${{ contains(github.ref, 'tags') }} | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: output.pdf | ||
asset_name: esteban_martinena_cv.pdf | ||
tag: ${{ github.ref }} | ||
overwrite: true | ||
body: "Latest version of my CV." | ||
# TODO: Attach pdf to readme.md using sed and the latest release | ||
# -name: Attach pdf to readme.md | ||
# run: | | ||
# echo "![CV]( | ||
# | ||
# )" | ||
# >> README.md | ||