chore(deps): update actions/checkout action to v6 #109
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 images | |
| on: | |
| workflow_dispatch: | |
| repository_dispatch: | |
| types: [biome-release-cli-event] | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| generate-jobs: | |
| name: Generate jobs | |
| runs-on: ubuntu-latest | |
| outputs: | |
| biome-versions: ${{ steps.matrix.outputs.BIOME_VERSIONS }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@735343b667d3e6f658f44d0eca948eb6282f2b76 # v2 | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Generate matrix | |
| id: matrix | |
| run: | | |
| BIOME_VERSIONS=$(bun run ./scripts/generate-versions.ts) | |
| echo "BIOME_VERSIONS=$BIOME_VERSIONS" >> $GITHUB_OUTPUT | |
| build-images-arm64: | |
| name: ${{ matrix.versions.patch }} (arm64) | |
| needs: generate-jobs | |
| concurrency: build-images-${{ matrix.versions.patch }}-arm64 | |
| permissions: | |
| packages: write | |
| runs-on: ubuntu-24.04-arm | |
| strategy: | |
| matrix: | |
| versions: ${{ fromJson(needs.generate-jobs.outputs.biome-versions) }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3 | |
| - name: Log in to the Container registry | |
| uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push | |
| uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6 | |
| with: | |
| push: ${{ github.event_name != 'pull_request' }} | |
| load: true | |
| provenance: false | |
| platforms: linux/arm64 | |
| tags: ghcr.io/biomejs/biome:${{ matrix.versions.patch }}-arm64 | |
| file: Dockerfile | |
| cache-from: type=gha,scope=${{ matrix.versions.patch}}-arm64 | |
| cache-to: type=gha,mode=max,scope=${{ matrix.versions.patch}}-arm64 | |
| build-args: | | |
| ARCH=arm64 | |
| BIOME_VERSION=${{ matrix.versions.patch }} | |
| BIOME_TAG_START=${{ matrix.versions.major == '2' && '@biomejs/biome@' || 'cli/v' }} | |
| - name: Verify image | |
| run: | | |
| docker run --pull=never --rm ghcr.io/biomejs/biome:${{ matrix.versions.patch }}-arm64 --version | |
| build-images-amd64: | |
| name: ${{ matrix.versions.patch }} (amd64) | |
| needs: generate-jobs | |
| concurrency: build-images-${{ matrix.versions.patch }}-amd64 | |
| permissions: | |
| packages: write | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| matrix: | |
| versions: ${{ fromJson(needs.generate-jobs.outputs.biome-versions) }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3 | |
| - name: Log in to the Container registry | |
| uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push | |
| uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6 | |
| with: | |
| push: ${{ github.event_name != 'pull_request' }} | |
| load: true | |
| provenance: false | |
| platforms: linux/amd64 | |
| tags: ghcr.io/biomejs/biome:${{ matrix.versions.patch }}-amd64 | |
| file: Dockerfile | |
| cache-from: type=gha,scope=${{ matrix.versions.patch}}-amd64 | |
| cache-to: type=gha,mode=max,scope=${{ matrix.versions.patch}}-amd64 | |
| build-args: | | |
| ARCH=x64 | |
| BIOME_VERSION=${{ matrix.versions.patch }} | |
| BIOME_TAG_START=${{ matrix.versions.major == '2' && '@biomejs/biome@' || 'cli/v' }} | |
| - name: Verify image | |
| run: | | |
| docker run --pull=never --rm ghcr.io/biomejs/biome:${{ matrix.versions.patch }}-amd64 --version | |
| stitch-images: | |
| name: Stitch images (${{ matrix.versions.patch }}) | |
| needs: [generate-jobs, build-images-arm64, build-images-amd64] | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| packages: write | |
| if: ${{ github.event_name != 'pull_request' }} | |
| strategy: | |
| matrix: | |
| versions: ${{ fromJson(needs.generate-jobs.outputs.biome-versions) }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3 | |
| - name: Log in to the Container registry | |
| uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create major version (${{ matrix.versions.major }}) manifest | |
| if: ${{ matrix.versions.createMajor }} | |
| run: | | |
| docker manifest create ghcr.io/biomejs/biome:${{ matrix.versions.major }} \ | |
| ghcr.io/biomejs/biome:${{ matrix.versions.patch }}-arm64 \ | |
| ghcr.io/biomejs/biome:${{ matrix.versions.patch }}-amd64 | |
| docker manifest push ghcr.io/biomejs/biome:${{ matrix.versions.major }} | |
| - name: Create minor version (${{ matrix.versions.minor }}) manifest | |
| if: ${{ matrix.versions.createMinor }} | |
| run: | | |
| docker manifest create ghcr.io/biomejs/biome:${{ matrix.versions.minor }} \ | |
| ghcr.io/biomejs/biome:${{ matrix.versions.patch }}-arm64 \ | |
| ghcr.io/biomejs/biome:${{ matrix.versions.patch }}-amd64 | |
| docker manifest push ghcr.io/biomejs/biome:${{ matrix.versions.minor }} | |
| - name: Create patch version (${{ matrix.versions.patch }}) manifest | |
| run: | | |
| docker manifest create ghcr.io/biomejs/biome:${{ matrix.versions.patch }} \ | |
| ghcr.io/biomejs/biome:${{ matrix.versions.patch }}-arm64 \ | |
| ghcr.io/biomejs/biome:${{ matrix.versions.patch }}-amd64 | |
| docker manifest push ghcr.io/biomejs/biome:${{ matrix.versions.patch }} | |
| - name: Create latest (${{ matrix.versions.patch }}) manifest | |
| if: | |
| ${{ matrix.versions.patch == | |
| fromJson(needs.generate-jobs.outputs.biome-versions)[0].patch }} | |
| run: | | |
| docker manifest create ghcr.io/biomejs/biome:latest \ | |
| ghcr.io/biomejs/biome:${{ matrix.versions.patch }}-arm64 \ | |
| ghcr.io/biomejs/biome:${{ matrix.versions.patch }}-amd64 | |
| docker manifest push ghcr.io/biomejs/biome:latest |