Cache docker image in CI #5
Workflow file for this run
This file contains hidden or 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 Document | |
| on: | |
| push: | |
| tags: | |
| - '*' | |
| workflow_dispatch: | |
| inputs: | |
| disable_docker_cache: | |
| type: boolean | |
| description: Forces docker image rebuild | |
| default: false | |
| skip_release: | |
| type: boolean | |
| description: Do not create a release from this run | |
| default: false | |
| jobs: | |
| build-latex: | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Cache Docker Image | |
| uses: ScribeMD/docker-cache@0.5.0 | |
| if: ${{ ! github.event.inputs.disable_docker_cache }} | |
| with: | |
| key: docker-${{ runner.os }}-${{ hashFiles('.devcontainer/Dockerfile') }} | |
| - name: Build image | |
| run: | | |
| docker build \ | |
| -f .devcontainer/Dockerfile \ | |
| -t thesis-builder:ci \ | |
| . | |
| - name: Run latexmk | |
| run: | | |
| docker run --rm \ | |
| -v "$GITHUB_WORKSPACE":/workspace \ | |
| -w /workspace \ | |
| thesis-builder:ci \ | |
| latexmk | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v2 | |
| if: ${{ ! github.event.inputs.skip_release }} | |
| with: | |
| name: Release ${{ github.ref_name }} | |
| generate_release_notes: true | |
| files: | | |
| dist/*.pdf |