diff --git a/.github/workflows/docker-nightly.yaml b/.github/workflows/docker-nightly.yaml new file mode 100644 index 0000000000..94ef1797c2 --- /dev/null +++ b/.github/workflows/docker-nightly.yaml @@ -0,0 +1,66 @@ +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 }}" \ No newline at end of file diff --git a/docker/README.md b/docker/README.md index 4a8dd09ab6..6545ec61c8 100644 --- a/docker/README.md +++ b/docker/README.md @@ -45,6 +45,32 @@ Create and activate a new builder and retry the bake command. docker buildx create --name kona-builder --use ``` +## Nightly Builds + +Nightly Docker images are automatically built and published every day at 2 AM UTC for: +- `kona-node` +- `kona-host` +- `kona-supervisor` + +### Using Nightly Images + +```sh +# Pull the latest nightly build (multi-platform: linux/amd64, linux/arm64) +docker pull ghcr.io/op-rs/kona/kona-node:nightly +docker pull ghcr.io/op-rs/kona/kona-host:nightly +docker pull ghcr.io/op-rs/kona/kona-supervisor:nightly + +# Pull a specific date's nightly build +docker pull ghcr.io/op-rs/kona/kona-node:nightly-2024-12-10 +``` + +### Manual Trigger + +To manually trigger a nightly build: +```sh +gh workflow run "Build and Publish Nightly Docker Images" +``` + ## Cutting a Release (for maintainers / forks) To cut a release of the docker image for any of the targets, cut a new annotated tag for the target like so: