Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 34 additions & 17 deletions .github/workflows/build-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,44 @@
# limitations under the License.
#

# Publishes the CI toolchain image from devops/docker/lake-builder.
# Push a tag `builder-vX.Y.Z` to publish `<owner>/devlake:lake-builder-vX.Y.Z`
# (see devops/docker/lake-builder/README.md). It uses the same Docker Hub
# credentials as build.yml. No moving `latest` tag is pushed: workflows pin
# an explicit version.
name: Build-BuilderImage-Push-Docker
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USER }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
on:
push:
tags:
- 'builder-*'
- 'builder-v*'
permissions:
contents: read
jobs:
build-lake:
name: Build lake-builder image
build-lake-builder:
name: Build and push lake-builder image
if: github.repository == 'apache/devlake'
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7
- uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0
with:
username: ${{ secrets.DOCKER_REGISTRY_USERNAME }}
password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
- name: Build lake image
run: |
cd devops/docker/lake-builder/
export IMAGE_LAKE=mericodev/lake-builder
export IMAGE_VER=${GITHUB_REF:18}
docker build -t $IMAGE_LAKE:latest --file ./Dockerfile .
docker tag $IMAGE_LAKE:latest $IMAGE_LAKE:$IMAGE_VER
docker push $IMAGE_LAKE:$IMAGE_VER
docker push $IMAGE_LAKE:latest
- uses: actions/checkout@v7
with:
persist-credentials: false
- name: Compute image tag
id: meta
run: echo "tag=lake-builder-${GITHUB_REF_NAME#builder-}" >> "$GITHUB_OUTPUT"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@37fe631027851001ddb9b187196cc803df7f5f0e # v4.3.0
- name: Login to DockerHub
uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0
with:
username: ${{ env.DOCKERHUB_USERNAME }}
password: ${{ env.DOCKERHUB_TOKEN }}
- name: Build and push lake-builder image
uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0
with:
context: devops/docker/lake-builder
push: true
tags: ${{ secrets.DOCKERHUB_OWNER }}/devlake:${{ steps.meta.outputs.tag }}
platforms: linux/amd64
22 changes: 9 additions & 13 deletions devops/docker/lake-builder/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,14 @@ limitations under the License.

Golang builder image for DevLake. Used by GitHub workflows.

https://hub.docker.com/r/mericodev/lake-builder

## Manual Release

```shell
export VERSION=0.0.11
docker build -t mericodev/lake-builder:$VERSION .
docker push mericodev/lake-builder:$VERSION
```
Published as `apache/devlake:lake-builder-v#.#.#`
(https://hub.docker.com/r/apache/devlake/tags?name=lake-builder).
Earlier versions (up to v0.0.15) were published as `mericodev/lake-builder`.

## Tagged Release
1. Create a tag matching the pattern `builder-v#.#.#`, e.g. `builder-v0.0.11`. Determine the previous tag first so you version
it correctly. Example command: `git tag builder-v0.0.11`
2. Push the tag to origin. Example command: `git push origin --tag builder-v0.0.11`
3. Done! This will trigger a GitHub workflow that will push this image to the Docker registry.
1. Create a tag matching the pattern `builder-v#.#.#`, e.g. `builder-v0.0.16`. Determine the previous tag first so you version
it correctly. Example command: `git tag builder-v0.0.16`
2. Push the tag to origin. Example command: `git push origin builder-v0.0.16`
3. The `Build-BuilderImage-Push-Docker` workflow (`.github/workflows/build-builder.yml`) builds this directory and pushes
`apache/devlake:lake-builder-v0.0.16`.
4. Point the `container:` lines in `.github/workflows/` to the new tag in a follow-up PR.
Loading