@@ -722,39 +722,45 @@ jobs:
722
722
project : wl5hnrrkns
723
723
context : base-build-context
724
724
file : scripts/Dockerfile.base
725
+ pull : true
726
+ push : true
725
727
platforms : linux/amd64,linux/arm64,linux/arm/v7
726
728
tags : ${{ steps.image-base-tag.outputs.base_tag }}
727
729
728
730
- name : Build Linux Docker images
731
+ id : build-docker
729
732
run : |
730
733
set -euxo pipefail
731
734
732
735
# build Docker images for each architecture
733
736
version="$(./scripts/version.sh)"
737
+ tag="main-$(echo "$version" | sed 's/+/-/g')"
738
+
734
739
make -j build/coder_"$version"_linux_{amd64,arm64,armv7}.tag
735
740
736
741
# build and push multi-arch manifest, this depends on the other images
737
- # being pushed so will automatically push them.
738
-
739
- # only push if we are on main branch
740
- if [ "${{ github.ref }}" == "refs/heads/main" ]; then
741
- make -j push/build/coder_"$version"_linux.tag
742
- else
743
- make -j build/coder_"$version"_linux.tag
744
- fi
742
+ # being pushed so will automatically push them
745
743
746
744
# only push if we are on main branch
747
745
if [ "${{ github.ref }}" == "refs/heads/main" ]; then
748
746
./scripts/build_docker_multiarch.sh \
749
747
--push \
750
- --target "$(./scripts/image_tag.sh --version main)" \
748
+ --target "ghcr.io/coder/coder-preview:$tag" \
749
+ --version $version \
751
750
$(cat build/coder_"$version"_linux_{amd64,arm64,armv7}.tag)
752
751
else
753
752
./scripts/build_docker_multiarch.sh \
754
- --target "$(./scripts/image_tag.sh --version main)" \
753
+ --target "ghcr.io/coder/coder-preview:$tag" \
754
+ --version $version \
755
755
$(cat build/coder_"$version"_linux_{amd64,arm64,armv7}.tag)
756
756
fi
757
757
758
+ # Tag as main
759
+ docker tag "ghcr.io/coder/coder-preview:$tag" ghcr.io/coder/coder-preview:main
760
+ docker push ghcr.io/coder/coder-preview:main
761
+
762
+ echo "tag=$tag" >> $GITHUB_OUTPUT
763
+
758
764
env :
759
765
CODER_BASE_IMAGE_TAG : ${{ steps.image-base-tag.outputs.base_tag }}
760
766
0 commit comments