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
27 changes: 16 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,52 +3,57 @@ name: build
on:
workflow_call:
inputs:
push:
deploy:
type: boolean
default: false

workflow_dispatch:
inputs:
push:
deploy:
type: boolean
default: false

jobs:
build:
runs-on: ubuntu-latest

defaults:
run:
shell: bash

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.push }}
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: |
type=ref,event=branch
type=sha
type=raw,value=latest,enable={{is_default_branch}}

- name: Build and push Docker image
uses: docker/build-push-action@v6.18.0
- name: Build and Deploy Docker image
uses: docker/build-push-action@v7.0.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
10 changes: 7 additions & 3 deletions .github/workflows/push.yml → .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -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
9 changes: 5 additions & 4 deletions .github/workflows/test.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions scripts/01_install_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
6 changes: 4 additions & 2 deletions scripts/02_install_hugo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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