@@ -655,7 +655,7 @@ jobs:
655
655
# to main branch. We are only building this for amd64 platform. (>95% pulls
656
656
# are for amd64)
657
657
needs : changes
658
- if : github.ref == 'refs/heads/main' && needs.changes.outputs.docs-only == 'false'
658
+ if : needs.changes.outputs.docs-only == 'false'
659
659
runs-on : ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }}
660
660
env :
661
661
DOCKER_CLI_EXPERIMENTAL : " enabled"
@@ -692,12 +692,57 @@ jobs:
692
692
go mod download
693
693
694
694
version="$(./scripts/version.sh)"
695
+ tag="main-$(echo "$version" | sed 's/+/-/g')"
696
+ echo "tag=$tag" >> $GITHUB_OUTPUT
697
+
695
698
make gen/mark-fresh
696
699
make -j \
697
700
build/coder_linux_amd64 \
698
701
build/coder_"$version"_windows_amd64.zip \
699
702
build/coder_"$version"_linux_amd64.{tar.gz,deb}
700
703
704
+ - name : Install depot.dev CLI
705
+ uses : depot/setup-action@v1
706
+
707
+ - name : Create an empty base-build-context directory
708
+ run : mkdir base-build-context
709
+
710
+ - name : Determine base image tag
711
+ id : image-base-tag
712
+ run : |
713
+ set -euo pipefail
714
+ version="$(./scripts/version.sh)"
715
+ echo "base_tag=$(CODER_IMAGE_BASE=coder-base ./scripts/image_tag.sh --version "$version")" >> $GITHUB_OUTPUT
716
+
717
+ # This uses OIDC authentication, so no auth variables are required.
718
+ - name : Build base Docker image via depot.dev
719
+ uses : depot/build-push-action@v1
720
+ with :
721
+ project : wl5hnrrkns
722
+ context : base-build-context
723
+ file : scripts/Dockerfile.base
724
+ platforms : linux/amd64,linux/arm64,linux/arm/v7
725
+ tags : ${{ steps.image-base-tag.outputs.base_tag }}
726
+
727
+ - name : Build Linux Docker images
728
+ run : |
729
+ set -euxo pipefail
730
+
731
+ # build Docker images for each architecture
732
+ version="$(./scripts/version.sh)"
733
+ make -j build/coder_"$version"_linux_{amd64,arm64,armv7}.tag
734
+
735
+ # build and push multi-arch manifest, this depends on the other images
736
+ # being pushed so will automatically push them.
737
+
738
+ make -j push/build/coder_"$version"_linux.tag
739
+ ./scripts/build_docker_multiarch.sh \
740
+ --push \
741
+ --target "$(./scripts/image_tag.sh --version latest)" \
742
+ $(cat build/coder_"$version"_linux_{amd64,arm64,armv7}.tag)
743
+ env :
744
+ CODER_BASE_IMAGE_TAG : ${{ steps.image-base-tag.outputs.base_tag }}
745
+
701
746
- name : Build and Push Linux amd64 Docker Image
702
747
id : build-docker
703
748
run : |
0 commit comments