From fd1e06b55640011cf5a9f28150d03bf13db5cc43 Mon Sep 17 00:00:00 2001 From: mrabine Date: Sun, 15 Mar 2026 08:58:58 +0100 Subject: [PATCH 1/5] set user home --- .github/workflows/build.yml | 16 +++++++++++----- .github/workflows/{push.yml => cd.yml} | 10 +++++++--- .github/workflows/{test.yml => ci.yml} | 9 +++++---- Dockerfile | 2 ++ 4 files changed, 25 insertions(+), 12 deletions(-) rename .github/workflows/{push.yml => cd.yml} (64%) rename .github/workflows/{test.yml => ci.yml} (71%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 62f0f1a..8388915 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,13 +3,13 @@ name: build on: workflow_call: inputs: - push: + deploy: type: boolean default: false workflow_dispatch: inputs: - push: + deploy: type: boolean default: false @@ -17,6 +17,10 @@ jobs: build: runs-on: ubuntu-latest + defaults: + run: + shell: bash + steps: - name: Checkout uses: actions/checkout@v4.2.2 @@ -28,7 +32,7 @@ jobs: uses: docker/setup-buildx-action@v3.11.1 - name: Log in to Docker Hub - if: ${{ inputs.push }} + if: ${{ inputs.deploy }} uses: docker/login-action@v3.4.0 with: username: ${{ secrets.DOCKERHUB_USER }} @@ -44,11 +48,13 @@ jobs: type=sha type=raw,value=latest,enable={{is_default_branch}} - - name: Build and push Docker image + - name: Deploy Docker image uses: docker/build-push-action@v6.18.0 with: context: . - push: ${{ inputs.push }} + push: ${{ inputs.deploy }} platforms: linux/amd64,linux/arm64 tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + cache-from: type=registry,ref=${{ secrets.DOCKERHUB_USER }}/join-ci:buildcache + cache-to: type=registry,ref=${{ secrets.DOCKERHUB_USER }}/join-ci:buildcache,mode=max diff --git a/.github/workflows/push.yml b/.github/workflows/cd.yml similarity index 64% rename from .github/workflows/push.yml rename to .github/workflows/cd.yml index 696267f..e1033b6 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/cd.yml @@ -1,12 +1,16 @@ -name: image +name: cd on: push: branches: [ main ] + workflow_dispatch: + jobs: - push: + deploy: uses: ./.github/workflows/build.yml + secrets: inherit + with: - push: true + deploy: true diff --git a/.github/workflows/test.yml b/.github/workflows/ci.yml similarity index 71% rename from .github/workflows/test.yml rename to .github/workflows/ci.yml index fee0ef4..02aac4c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/ci.yml @@ -1,12 +1,13 @@ -name: pr +name: ci on: pull_request: branches: [ main ] + workflow_dispatch: + jobs: - test: + check: uses: ./.github/workflows/build.yml + secrets: inherit - with: - push: false diff --git a/Dockerfile b/Dockerfile index 59779be..370e238 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,6 +16,8 @@ RUN apt-get update && bash -xe ./01*.sh && rm -rf * && rm -rf /var/lib/apt/lists COPY scripts/02*.sh . RUN apt-get update && bash -xe ./02*.sh && rm -rf * && rm -rf /var/lib/apt/lists/* +USER root +ENV HOME=/root WORKDIR /github/workspace CMD ["/bin/bash"] From 1f717e17e463563fd8aeedd014e6bd6e00970cf8 Mon Sep 17 00:00:00 2001 From: mrabine Date: Sun, 15 Mar 2026 09:02:31 +0100 Subject: [PATCH 2/5] rename step --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8388915..c83d1bd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -48,7 +48,7 @@ jobs: type=sha type=raw,value=latest,enable={{is_default_branch}} - - name: Deploy Docker image + - name: Build and Deploy Docker image uses: docker/build-push-action@v6.18.0 with: context: . From 736f3d76c100c49021739e018d608cbcdd537681 Mon Sep 17 00:00:00 2001 From: mrabine Date: Sun, 15 Mar 2026 09:11:52 +0100 Subject: [PATCH 3/5] set build cache --- .github/workflows/build.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c83d1bd..1522daf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,24 +23,23 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4.2.2 + uses: actions/checkout@v6.0.2 - name: Set up QEMU - uses: docker/setup-qemu-action@v3.6.0 + uses: docker/setup-qemu-action@v4.0.0 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3.11.1 + uses: docker/setup-buildx-action@v4.0.0 - name: Log in to Docker Hub - if: ${{ inputs.deploy }} - uses: docker/login-action@v3.4.0 + uses: docker/login-action@v4.0.0 with: username: ${{ secrets.DOCKERHUB_USER }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Extract Docker metadata id: meta - uses: docker/metadata-action@v5.7.0 + uses: docker/metadata-action@v6.0.0 with: images: ${{ secrets.DOCKERHUB_USER }}/join-ci tags: | @@ -49,7 +48,7 @@ jobs: type=raw,value=latest,enable={{is_default_branch}} - name: Build and Deploy Docker image - uses: docker/build-push-action@v6.18.0 + uses: docker/build-push-action@v7.0.0 with: context: . push: ${{ inputs.deploy }} From 385af800303c48da6d4c649f829077253db2b9bc Mon Sep 17 00:00:00 2001 From: mrabine Date: Sun, 15 Mar 2026 09:26:15 +0100 Subject: [PATCH 4/5] set build cache --- scripts/01_install_dependencies.sh | 3 +-- scripts/02_install_hugo.sh | 6 ++++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/01_install_dependencies.sh b/scripts/01_install_dependencies.sh index f806655..e50560d 100644 --- a/scripts/01_install_dependencies.sh +++ b/scripts/01_install_dependencies.sh @@ -20,13 +20,12 @@ apt-get -qq install \ clang \ llvm \ ninja-build \ - wget \ python3 \ python3-pip \ bash \ jq \ libc6-dev \ - libglib2.0-0 \ + libglib2.0-dev \ libtrace-tools \ lcov \ libclang-rt-dev \ diff --git a/scripts/02_install_hugo.sh b/scripts/02_install_hugo.sh index 8245686..8427e4a 100644 --- a/scripts/02_install_hugo.sh +++ b/scripts/02_install_hugo.sh @@ -13,6 +13,8 @@ else fi wget https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-${HUGO_ARCH}.tar.gz -tar -xvzf hugo_extended_${HUGO_VERSION}_linux-${HUGO_ARCH}.tar.gz +wget https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_${HUGO_VERSION}_checksums.txt +grep "hugo_extended_${HUGO_VERSION}_linux-${HUGO_ARCH}.tar.gz" hugo_${HUGO_VERSION}_checksums.txt | sha256sum -c - +tar -xzf hugo_extended_${HUGO_VERSION}_linux-${HUGO_ARCH}.tar.gz mv hugo /usr/local/bin/ -rm hugo_extended_${HUGO_VERSION}_linux-${HUGO_ARCH}.tar.gz LICENSE README.md +rm hugo_extended_${HUGO_VERSION}_linux-${HUGO_ARCH}.tar.gz hugo_${HUGO_VERSION}_checksums.txt LICENSE README.md From 0153269b51bf38c48e1b8674050b8655ac2e5b7c Mon Sep 17 00:00:00 2001 From: mrabine Date: Sun, 15 Mar 2026 09:34:01 +0100 Subject: [PATCH 5/5] update readme --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2e9d710..77b7bee 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,12 @@ This is an Ubuntu based docker image, with all the mandatory tools for the join To create the docker image do this: ```bash -docker build -t joinframework/join-ci . +docker buildx build --platform linux/amd64,linux/arm64 -t joinframework/join-ci . +``` + +To create and test locally for a single platform do this: +```bash +docker buildx build --platform linux/amd64 --load -t joinframework/join-ci . ``` ## Testing image