Initial commit #44
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
| # .github/workflows/build-images.yml | |
| # Builds and pushes the full DocOps Box image matrix to Docker Hub. | |
| # | |
| # The build logic lives in scripts/build-matrix.sh; this workflow is a thin | |
| # harness that sets up the multi-platform build environment and invokes it. | |
| # | |
| # Triggers: | |
| # - Push to `latest` branch (auto-build on merge) | |
| # - Manual dispatch with optional dry-run flag | |
| # | |
| # Required repository secrets: | |
| # DOCKERHUB_USERNAME — Docker Hub username | |
| # DOCKERHUB_PASSWORD — Docker Hub access token (not your password) | |
| # | |
| # To add a new image to the matrix, edit scripts/build-matrix.sh only. | |
| name: Build and Push Image Matrix | |
| on: | |
| push: | |
| branches: | |
| - latest | |
| # Only trigger when files that affect the built image actually change. | |
| # Docs, README, agent notes, etc. do not need a full 12-image rebuild. | |
| paths: | |
| - 'Dockerfile' | |
| - 'hooks/early/pre-build.sh' | |
| - 'hooks/late/entrypoint.sh' | |
| - 'hooks/late/docops' | |
| - 'hooks/late/post-build.sh' | |
| - 'templates/.zshrc' | |
| - 'scripts/build-matrix.sh' | |
| - '.github/workflows/build-images.yml' | |
| workflow_dispatch: | |
| inputs: | |
| dry_run: | |
| description: "Dry run — print commands without building or pushing" | |
| required: false | |
| default: "false" | |
| type: boolean | |
| jobs: | |
| build-matrix: | |
| name: Build image matrix | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| # QEMU adds emulation layers so BuildKit can produce ARM64 images | |
| # on the AMD64 GitHub-hosted runner. | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| # Buildx is the CLI plugin that drives multi-platform builds via BuildKit. | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
| - name: Build and push image matrix | |
| run: | | |
| if [[ "${{ inputs.dry_run }}" == "true" ]]; then | |
| ./scripts/build-matrix.sh --dry-run | |
| else | |
| ./scripts/build-matrix.sh --push --gha-cache | |
| fi |