Skip to content

ci: build a multi-arch image on each commit to main #11544

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 30 commits into from
Jan 18, 2024
Merged
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
cfe0ddc
wip
matifali Jan 10, 2024
b13efd7
`fmt`
matifali Jan 10, 2024
131a227
wip
matifali Jan 10, 2024
88102bd
Merge branch 'main' into multi-arch-main
matifali Jan 10, 2024
206a11c
wip
matifali Jan 10, 2024
cef4eb7
add condition to not push
matifali Jan 10, 2024
bcbafce
enable push and pull for base image
matifali Jan 10, 2024
1332c94
update project
matifali Jan 10, 2024
7894508
Tagged Docker image as main
matifali Jan 10, 2024
e9d2421
use free runner
matifali Jan 10, 2024
568560c
do not push
matifali Jan 10, 2024
30e9470
use larger runner
matifali Jan 10, 2024
8dd78cd
wip
matifali Jan 10, 2024
29e43e9
do not build base
matifali Jan 10, 2024
3d28596
remove excess permission
matifali Jan 10, 2024
0d1233b
cleanup
matifali Jan 10, 2024
5caf911
wip
matifali Jan 10, 2024
71e8145
test
matifali Jan 10, 2024
65678a7
test
matifali Jan 10, 2024
d3ee831
test
matifali Jan 10, 2024
6816e10
Update Docker image tags and retention policy
matifali Jan 10, 2024
4116e94
cleanup
matifali Jan 10, 2024
8b39c8b
Add prune-tags-regexes to CI workflow
matifali Jan 10, 2024
6fbfcb6
prune intermediate images for each arch.
matifali Jan 11, 2024
9f5725d
Merge branch 'main' into multi-arch-main
matifali Jan 11, 2024
7c91a25
prevent tags cleanup and artifact upload on PR branches
matifali Jan 11, 2024
ec5cd53
Merge branch 'main' into multi-arch-main
matifali Jan 17, 2024
e48d0c9
pr suggestions
matifali Jan 17, 2024
dc07bef
Merge branch 'main' into multi-arch-main
matifali Jan 17, 2024
319ffa1
PR commnets
matifali Jan 18, 2024
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
Prev Previous commit
Next Next commit
enable push and pull for base image
  • Loading branch information
matifali committed Jan 10, 2024
commit bcbafce64e979af86ad76cfa70d885be4b90feae
26 changes: 16 additions & 10 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -722,39 +722,45 @@ jobs:
project: wl5hnrrkns
context: base-build-context
file: scripts/Dockerfile.base
pull: true
push: true
platforms: linux/amd64,linux/arm64,linux/arm/v7
tags: ${{ steps.image-base-tag.outputs.base_tag }}

- name: Build Linux Docker images
id: build-docker
run: |
set -euxo pipefail

# build Docker images for each architecture
version="$(./scripts/version.sh)"
tag="main-$(echo "$version" | sed 's/+/-/g')"

make -j build/coder_"$version"_linux_{amd64,arm64,armv7}.tag

# build and push multi-arch manifest, this depends on the other images
# being pushed so will automatically push them.

# only push if we are on main branch
if [ "${{ github.ref }}" == "refs/heads/main" ]; then
make -j push/build/coder_"$version"_linux.tag
else
make -j build/coder_"$version"_linux.tag
fi
# being pushed so will automatically push them

# only push if we are on main branch
if [ "${{ github.ref }}" == "refs/heads/main" ]; then
./scripts/build_docker_multiarch.sh \
--push \
--target "$(./scripts/image_tag.sh --version main)" \
--target "ghcr.io/coder/coder-preview:$tag" \
--version $version \
$(cat build/coder_"$version"_linux_{amd64,arm64,armv7}.tag)
else
./scripts/build_docker_multiarch.sh \
--target "$(./scripts/image_tag.sh --version main)" \
--target "ghcr.io/coder/coder-preview:$tag" \
--version $version \
$(cat build/coder_"$version"_linux_{amd64,arm64,armv7}.tag)
fi

# Tag as main
docker tag "ghcr.io/coder/coder-preview:$tag" ghcr.io/coder/coder-preview:main
docker push ghcr.io/coder/coder-preview:main

echo "tag=$tag" >> $GITHUB_OUTPUT

env:
CODER_BASE_IMAGE_TAG: ${{ steps.image-base-tag.outputs.base_tag }}

Expand Down