Skip to content

Commit bcbafce

Browse files
committed
enable push and pull for base image
1 parent cef4eb7 commit bcbafce

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

.github/workflows/ci.yaml

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -722,39 +722,45 @@ jobs:
722722
project: wl5hnrrkns
723723
context: base-build-context
724724
file: scripts/Dockerfile.base
725+
pull: true
726+
push: true
725727
platforms: linux/amd64,linux/arm64,linux/arm/v7
726728
tags: ${{ steps.image-base-tag.outputs.base_tag }}
727729

728730
- name: Build Linux Docker images
731+
id: build-docker
729732
run: |
730733
set -euxo pipefail
731734
732735
# build Docker images for each architecture
733736
version="$(./scripts/version.sh)"
737+
tag="main-$(echo "$version" | sed 's/+/-/g')"
738+
734739
make -j build/coder_"$version"_linux_{amd64,arm64,armv7}.tag
735740
736741
# 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
745743
746744
# only push if we are on main branch
747745
if [ "${{ github.ref }}" == "refs/heads/main" ]; then
748746
./scripts/build_docker_multiarch.sh \
749747
--push \
750-
--target "$(./scripts/image_tag.sh --version main)" \
748+
--target "ghcr.io/coder/coder-preview:$tag" \
749+
--version $version \
751750
$(cat build/coder_"$version"_linux_{amd64,arm64,armv7}.tag)
752751
else
753752
./scripts/build_docker_multiarch.sh \
754-
--target "$(./scripts/image_tag.sh --version main)" \
753+
--target "ghcr.io/coder/coder-preview:$tag" \
754+
--version $version \
755755
$(cat build/coder_"$version"_linux_{amd64,arm64,armv7}.tag)
756756
fi
757757
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+
758764
env:
759765
CODER_BASE_IMAGE_TAG: ${{ steps.image-base-tag.outputs.base_tag }}
760766

0 commit comments

Comments
 (0)