Skip to content
Open
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
25 changes: 25 additions & 0 deletions publish-chart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,26 @@ It can simply be used as a step in a GitHub actions job:
GITHUB_TOKEN: ${{ secrets.CI_TOKEN }}
```

When doing a multi-platform build:

```yaml
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- uses: SwissDataScienceCenter/renku/actions/publish-chart@master
env:
CHART_DIR: helm-chart/mychart # path to the chart directory
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrest.DOCKER_PASSWORD }}
GITHUB_TOKEN: ${{ secrets.CI_TOKEN }}
PLATFORMS: "linux/amd64,linux/arm64"
```

Note that the `CI_TOKEN` needs write permissions to wherever the chart is
published to.

Expand All @@ -36,3 +56,8 @@ You can set these environment variables:
| GITHUB_TOKEN | None | Yes |
| IMAGE_PREFIX | None | No |
| CHARTPRESS_SPEC_DIR | . | No |
| PLATFORMS | linux/amd64 | No |

Platforms can be specified as a comma-separated list of values. For example, to
build images for amd64 and arm64 platforms, set `PLATFORMS` to
`linux/amd64,linux/arm64`.
15 changes: 14 additions & 1 deletion publish-chart/publish-chart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,19 @@ if [ -z "$CHARTPRESS_SPEC_DIR" ]; then
CHARTPRESS_SPEC_DIR="."
fi

PLATFORM_ARGS=""
BUILDER_ARG=""
if [ ! -z "$PLATFORMS" ]; then
# setting up docker-buildx for multi-platform builds
docker buildx create --name multiarch --use
docker buildx inspect --bootstrap

for platform in $(echo $PLATFORMS | tr ',' ' '); do
PLATFORM_ARGS="$PLATFORM_ARGS --platform $platform"
done
BUILDER_ARG="--builder docker-buildx"
fi

# set up git
git config --global user.email "$GIT_EMAIL"
git config --global user.name "$GIT_USER"
Expand All @@ -49,4 +62,4 @@ echo ${DOCKER_PASSWORD} | docker login -u ${DOCKER_USERNAME} --password-stdin

# build and push the chart and images
cd $CHARTPRESS_SPEC_DIR
chartpress --push --publish-chart $CHART_TAG $IMAGE_PREFIX
chartpress --push --publish-chart $CHART_TAG $IMAGE_PREFIX $PLATFORM_ARGS $BUILDER_ARG
28 changes: 24 additions & 4 deletions publish-chartpress-images/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,25 @@ It can simply be used as a step in a GitHub actions job:
DOCKER_PASSWORD: ${{ secrest.DOCKER_PASSWORD }}
```

When doing a multi-platform build:

```yaml
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- uses: SwissDataScienceCenter/renku/actions/publish-chartpress-images@master
env:
CHART_DIR: helm-chart/mychart # path to the chart directory
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrest.DOCKER_PASSWORD }}
PLATFORMS: "linux/amd64,linux/arm64"
```

## Configuration

You can set these environment variables:
Expand All @@ -32,8 +51,9 @@ You can set these environment variables:
| PUSH_LATEST | None | No |
| PLATFORMS | linux/amd64 | No |

Note: setting the `PUSH_LATEST` variable to any non-zero value will trigger the publishing of
the images with the `latest` tag.

Platforms can be specified as a comma-separated list of values. For example, to build images for amd64 and arm64 platforms, set `PLATFORMS` to `linux/amd64,linux/arm64`.
Note: setting the `PUSH_LATEST` variable to any non-zero value will trigger the
publishing of the images with the `latest` tag.

Platforms can be specified as a comma-separated list of values. For example, to
build images for amd64 and arm64 platforms, set `PLATFORMS` to
`linux/amd64,linux/arm64`.