v0.18.16 #43
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
| # Build, publish, and tag the container and use it to render the PDF for releases. | |
| name: release | |
| on: | |
| release: | |
| types: [published] | |
| env: | |
| REGISTRY: ghcr.io | |
| IMAGE_NAME: ${{ github.repository }} | |
| jobs: | |
| build-container: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| # A recent run of du -sh /opt/hostedtoolcache/* | sort -h yielded: | |
| # 24K /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk | |
| # 217M /opt/hostedtoolcache/Ruby | |
| # 520M /opt/hostedtoolcache/PyPy | |
| # 574M /opt/hostedtoolcache/node | |
| # 1.1G /opt/hostedtoolcache/go | |
| # 1.7G /opt/hostedtoolcache/CodeQL | |
| # 1.9G /opt/hostedtoolcache/Python | |
| # Since we are just building a Docker container we delete some unused | |
| # pre-installed tools to make space. | |
| - name: Free up disk space by deleting /opt/hostedtoolcache/CodeQL | |
| run: rm -rf /opt/hostedtoolcache/CodeQL | |
| - name: Free up disk space by deleting /opt/hostedtoolcache/Python | |
| run: rm -rf /opt/hostedtoolcache/Python | |
| # Login against a Docker registry | |
| # https://github.com/docker/login-action | |
| - name: Log into registry | |
| uses: docker/[email protected] | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| # Set up QEMU for cross-platform builds below | |
| - name: Set up QEMU | |
| uses: docker/[email protected] | |
| with: | |
| image: tonistiigi/binfmt:latest | |
| platforms: all | |
| - name: Setup Docker buildx | |
| uses: docker/[email protected] | |
| # Extract metadata (tags, labels) for Docker | |
| # https://github.com/docker/metadata-action | |
| - name: Extract Docker metadata | |
| id: meta | |
| uses: docker/[email protected] | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
| tags: | | |
| type=ref,event=branch | |
| type=semver,pattern={{version}} | |
| # Build and push Docker image with Buildx | |
| # https://github.com/docker/build-push-action | |
| - name: Build and publish Docker image | |
| uses: docker/[email protected] | |
| with: | |
| # Cache layers from the container repo. | |
| # Read-only: Releasing shouldn't be doing anything that wasn't already | |
| # one on a push to main earlier. | |
| cache-from: type=gha | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| # Use the fresh container to render the samples, attaching them to the release. | |
| render-samples: | |
| needs: build-container | |
| uses: ./.github/workflows/render.yml | |
| with: | |
| container-version: latest | |
| input: guide.tcg | |
| workflow: release |