Bucketeer Dev Container Build and Push Image #34
Workflow file for this run
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: Bucketeer Dev Container Build and Push Image | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - ".github/.devcontainer/**" | |
| jobs: | |
| # Build separate architectures in parallel for speed | |
| build-amd64: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout (GitHub) | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - name: Setup Docker buildx | |
| uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1 | |
| with: | |
| use: true | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push AMD64 image | |
| uses: docker/build-push-action@48aba3b46d1b1fec4febb7c5d0c644b249a11355 # v6.10.0 | |
| with: | |
| context: .github/.devcontainer | |
| platforms: linux/amd64 | |
| push: true | |
| tags: ghcr.io/bucketeer-io/bucketeer-devcontainer:amd64-${{ github.sha }} | |
| cache-from: type=gha,scope=amd64 | |
| cache-to: type=gha,mode=max,scope=amd64 | |
| provenance: false | |
| build-args: | | |
| BUILDKIT_INLINE_CACHE=1 | |
| build-arm64: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout (GitHub) | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - name: Set up QEMU for ARM64 builds | |
| uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0 | |
| with: | |
| platforms: linux/arm64 | |
| - name: Setup Docker buildx | |
| uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1 | |
| with: | |
| use: true | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push ARM64 image | |
| uses: docker/build-push-action@48aba3b46d1b1fec4febb7c5d0c644b249a11355 # v6.10.0 | |
| with: | |
| context: .github/.devcontainer | |
| platforms: linux/arm64 | |
| push: true | |
| tags: ghcr.io/bucketeer-io/bucketeer-devcontainer:arm64-${{ github.sha }} | |
| cache-from: type=gha,scope=arm64 | |
| cache-to: type=gha,mode=max,scope=arm64 | |
| provenance: false | |
| build-args: | | |
| BUILDKIT_INLINE_CACHE=1 | |
| # Create multi-arch manifest that combines both architectures | |
| create-manifest: | |
| runs-on: ubuntu-latest | |
| needs: [build-amd64, build-arm64] | |
| steps: | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create and push multi-arch manifest | |
| run: | | |
| # Create manifest list that includes both architectures | |
| docker manifest create \ | |
| ghcr.io/bucketeer-io/bucketeer-devcontainer:latest \ | |
| --amend ghcr.io/bucketeer-io/bucketeer-devcontainer:amd64-${{ github.sha }} \ | |
| --amend ghcr.io/bucketeer-io/bucketeer-devcontainer:arm64-${{ github.sha }} | |
| # Also create SHA-specific manifest (for debugging) | |
| docker manifest create \ | |
| ghcr.io/bucketeer-io/bucketeer-devcontainer:${{ github.sha }} \ | |
| --amend ghcr.io/bucketeer-io/bucketeer-devcontainer:amd64-${{ github.sha }} \ | |
| --amend ghcr.io/bucketeer-io/bucketeer-devcontainer:arm64-${{ github.sha }} | |
| # Push manifests | |
| docker manifest push ghcr.io/bucketeer-io/bucketeer-devcontainer:latest | |
| docker manifest push ghcr.io/bucketeer-io/bucketeer-devcontainer:${{ github.sha }} |