Skip to content

Commit 57c7d7d

Browse files
authored
ci: build and push ghcr.io/coder/coder-preview:main (#8832)
1 parent 496ec6c commit 57c7d7d

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

.github/workflows/ci.yaml

+46
Original file line numberDiff line numberDiff line change
@@ -714,3 +714,49 @@ jobs:
714714
fi
715715
716716
echo "Required checks have passed"
717+
718+
build-main-image:
719+
# This build and publihes ghcr.io/coder/coder-preview:main for each merge commit to main branch.
720+
# We are only building this for amd64 plateform. (>95% pulls are for amd64)
721+
needs: changes
722+
if: github.ref == 'refs/heads/main' && needs.changes.outputs.docs-only == 'false'
723+
runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }}
724+
env:
725+
DOCKER_CLI_EXPERIMENTAL: "enabled"
726+
steps:
727+
- name: Checkout
728+
uses: actions/checkout@v3
729+
with:
730+
fetch-depth: 0
731+
732+
- name: Setup Node
733+
uses: ./.github/actions/setup-node
734+
735+
- name: Setup Go
736+
uses: ./.github/actions/setup-go
737+
738+
- name: Setup sqlc
739+
uses: ./.github/actions/setup-sqlc
740+
741+
- name: GHCR Login
742+
uses: docker/login-action@v2
743+
with:
744+
registry: ghcr.io
745+
username: ${{ github.actor }}
746+
password: ${{ secrets.GITHUB_TOKEN }}
747+
748+
- name: Build and push Linux amd64 Docker image
749+
run: |
750+
set -euxo pipefail
751+
go mod download
752+
make gen/mark-fresh
753+
export DOCKER_IMAGE_NO_PREREQUISITES=true
754+
version="$(./scripts/version.sh)"
755+
export CODER_IMAGE_BUILD_BASE_TAG="$(CODER_IMAGE_BASE=coder-base ./scripts/image_tag.sh --version "$version")"
756+
make -j build/coder_linux_amd64
757+
./scripts/build_docker.sh \
758+
--arch amd64 \
759+
--target ghcr.io/coder/coder-preview:main \
760+
--version $version \
761+
--push \
762+
build/coder_linux_amd64

0 commit comments

Comments
 (0)