| name: Build CI Base Image (GnuTLS+leancrypto / MbedTLS) |
| |
| # Builds and publishes the debian:forky-based CI base image used by the |
| # build-linux-combos matrix in build-and-test.yml. See .github/docker/README.md. |
| |
| on: |
| workflow_dispatch: |
| push: |
| branches: [ "master" ] |
| paths: |
| - ".github/docker/Dockerfile" |
| - ".github/workflows/ci-image.yml" |
| |
| # Least privilege: read the repo, write packages (GHCR) via GITHUB_TOKEN. |
| permissions: |
| contents: read |
| packages: write |
| |
| env: |
| REGISTRY: ghcr.io |
| IMAGE_NAME: ${{ github.repository }}/gnutls-leancrypto-mbedtls |
| |
| jobs: |
| build-and-push: |
| runs-on: ubuntu-latest |
| steps: |
| - name: Checkout |
| uses: actions/checkout@v5 |
| |
| - name: Set up Docker Buildx |
| uses: docker/setup-buildx-action@v3 |
| |
| - name: Log in to GHCR |
| uses: docker/login-action@v3 |
| with: |
| registry: ${{ env.REGISTRY }} |
| username: ${{ github.actor }} |
| password: ${{ secrets.GITHUB_TOKEN }} |
| |
| - name: Derive lowercase image ref |
| id: meta |
| run: echo "image=${REGISTRY,,}/${IMAGE_NAME,,}" >> "$GITHUB_OUTPUT" |
| |
| - name: Build and push |
| uses: docker/build-push-action@v6 |
| with: |
| context: . |
| file: .github/docker/Dockerfile |
| platforms: linux/amd64 |
| push: true |
| tags: | |
| ${{ steps.meta.outputs.image }}:latest |
| ${{ steps.meta.outputs.image }}:forky |
| ${{ steps.meta.outputs.image }}:${{ github.sha }} |
| labels: | |
| org.opencontainers.image.source=https://github.com/${{ github.repository }} |
| org.opencontainers.image.revision=${{ github.sha }} |
| cache-from: type=gha |
| cache-to: type=gha,mode=max |
| provenance: false |