Docker build #7
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
| # This action enables building container images with manual trigger/ | |
| # | |
| # Container images are only pushed to GitHub Container Registry for releases. | |
| name: Docker build | |
| on: | |
| workflow_dispatch: | |
| # Incremental compilation here isn't helpful | |
| env: | |
| CARGO_INCREMENTAL: 0 | |
| jobs: | |
| build: | |
| runs-on: [ ubuntu-latest ] | |
| permissions: | |
| contents: read | |
| packages: write | |
| strategy: | |
| matrix: | |
| build: | |
| - image: node-utils | |
| context: modules/node-utils | |
| fail-fast: false | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
| - name: Docker meta | |
| id: meta | |
| uses: docker/metadata-action@v3 | |
| with: | |
| images: | | |
| ghcr.io/${{ github.repository }}/${{ matrix.build.image }} | |
| tags: | | |
| type=raw,value=latest | |
| - name: Log into registry | |
| uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ github.token }} | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3.7.1 | |
| - name: Build and push ${{ matrix.build.image }} image | |
| uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6.9.0 | |
| with: | |
| context: ${{ matrix.build.context }} | |
| platforms: linux/amd64,linux/amd64/v2,linux/amd64/v3,linux/arm64 | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} |