Build and Publish Nightly Docker Images #75
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 and Publish Nightly Docker Images | |
| on: | |
| # Run nightly at 2 AM UTC | |
| schedule: | |
| - cron: '0 2 * * *' | |
| # Allow manual trigger | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| packages: write | |
| env: | |
| REGISTRY: ghcr.io | |
| REGISTRY_IMAGE: ghcr.io/op-rs/kona | |
| jobs: | |
| build-nightly: | |
| name: Build Nightly Images | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| target: [kona-node, kona-host, kona-supervisor, kona-client] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Authenticate with container registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Generate Docker metadata | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ${{ env.REGISTRY_IMAGE }}/${{ matrix.target }} | |
| tags: | | |
| type=raw,value=nightly | |
| type=raw,value=nightly-{{date 'YYYY-MM-DD'}} | |
| - name: Build and push multi-platform image | |
| uses: docker/bake-action@v6 | |
| env: | |
| BIN_TARGET: ${{ matrix.target }} | |
| REPO_LOCATION: local | |
| PLATFORMS: linux/amd64,linux/arm64 | |
| with: | |
| files: | | |
| ./docker/docker-bake.hcl | |
| ${{ steps.meta.outputs.bake-file }} | |
| targets: generic | |
| push: true | |
| - name: Display image info | |
| run: | | |
| echo "✅ Successfully built and pushed ${{ matrix.target }}" | |
| echo "📦 Image: ${{ env.REGISTRY_IMAGE }}/${{ matrix.target }}:nightly" | |
| echo "🏷️ Tags: ${{ steps.meta.outputs.tags }}" |