Fix Docker container dependencies and improve LaTeX error reporting #4
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 & Push Docker Image | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'tools/Dockerfile' | |
| - '.github/workflows/docker-image.yml' | |
| # Allow manual triggering | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: 'Tag for the Docker image' | |
| required: false | |
| default: 'latest' | |
| type: string | |
| env: | |
| REGISTRY: ghcr.io | |
| IMAGE_NAME: carbondirect/boost/boost-builder | |
| jobs: | |
| build-and-push: | |
| name: 🏗️ Build Docker Image | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Log in to Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Extract metadata | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
| tags: | | |
| type=ref,event=branch | |
| type=ref,event=pr | |
| type=sha,prefix={{branch}}- | |
| type=raw,value=latest,enable={{is_default_branch}} | |
| type=raw,value=${{ inputs.tag || 'latest' }},enable=${{ github.event_name == 'workflow_dispatch' }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: ./tools/Dockerfile | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| - name: Verify image | |
| run: | | |
| echo "🐳 Docker image built and pushed successfully!" | |
| echo "📦 Image tags:" | |
| echo "${{ steps.meta.outputs.tags }}" | |
| echo "" | |
| echo "🔧 To use this image in workflows:" | |
| echo "container: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest" |