π·π» pass ALPINE_VERSION to docker build #16
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 Docker Image | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| on: | |
| push: | |
| branches: [ "*" ] | |
| tags: [ "*" ] | |
| env: | |
| RUST_VERSION: 1.90.0 | |
| ALPINE_VERSION: 3.22 | |
| PLATFORMS: linux/amd64,linux/arm64/v8 | |
| REGISTRY: ghcr.io | |
| jobs: | |
| build: | |
| name: Build Docker Image | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| contents: read | |
| attestations: write | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Login to Container Registry | |
| uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ github.token }} | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0 | |
| - name: Setup Docker Buildx | |
| uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1 | |
| - name: Extract Docker metadata | |
| uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f # v5.8.0 | |
| id: meta | |
| with: | |
| images: ghcr.io/${{ github.repository }} | |
| flavor: latest=true | |
| - name: Build Docker image | |
| uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0 | |
| id: docker_build | |
| with: | |
| context: . | |
| push: true | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| platforms: ${{ env.PLATFORMS }} | |
| build-args: | | |
| RUST_VERSION=${{ env.RUST_VERSION }} | |
| ALPINE_VERSION=${{ env.ALPINE_VERSION }} | |
| - name: Attest | |
| uses: actions/attest-build-provenance@977bb373ede98d70efdf65b84cb5f73e068dcc2a # v3.0.0 | |
| id: attest | |
| with: | |
| subject-name: ${{ env.REGISTRY }}/${{ github.repository }} | |
| subject-digest: ${{ steps.docker_build.outputs.digest }} | |
| push-to-registry: true |