Repository navigation
test: remove idle HTTP reuse race and await server readiness #4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: images | |
| # On every push to main (and manually), after CI passes: build each image once, push sha-<commit> and edge, and attest the | |
| # exact pushed digest (the Cortex supervisor refuses a digest without build provenance). | |
| # vX.Y.Z and stable are aliases of an already attested sha- digest, made by release.yml. | |
| on: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: images-main | |
| cancel-in-progress: false | |
| jobs: | |
| ci: | |
| uses: ./.github/workflows/ci.yml | |
| publish: | |
| needs: ci | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 120 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - dockerfile: docker/Dockerfile.server | |
| image: ghcr.io/cortexlm/hypertrain | |
| - dockerfile: docker/Dockerfile.gpu | |
| image: ghcr.io/cortexlm/hypertrain-gpu | |
| permissions: | |
| contents: read | |
| packages: write | |
| id-token: write | |
| attestations: write | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Free disk for the CUDA base image | |
| if: matrix.dockerfile == 'docker/Dockerfile.gpu' | |
| run: | | |
| sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL | |
| df -h / | |
| - name: Read version | |
| id: meta | |
| run: | | |
| version=$(python3 -c 'import tomllib; print(tomllib.load(open("pyproject.toml","rb"))["project"]["version"])') | |
| echo "version=${version}" >> "$GITHUB_OUTPUT" | |
| - uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1 | |
| - uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push | |
| id: build | |
| uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0 | |
| with: | |
| context: . | |
| file: ${{ matrix.dockerfile }} | |
| push: true | |
| platforms: linux/amd64 | |
| provenance: false | |
| sbom: false | |
| build-args: | | |
| VERSION=${{ steps.meta.outputs.version }} | |
| REVISION=${{ github.sha }} | |
| tags: | | |
| ${{ matrix.image }}:sha-${{ github.sha }} | |
| ${{ matrix.image }}:edge | |
| - name: Attest build provenance | |
| uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2 | |
| with: | |
| subject-name: ${{ matrix.image }} | |
| subject-digest: ${{ steps.build.outputs.digest }} | |
| push-to-registry: true |