build: move runtime baseline to Node 24 #67
Workflow file for this run
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: Terminay Server Image | |
| on: | |
| pull_request: | |
| paths: | |
| - Dockerfile | |
| - .dockerignore | |
| - .github/workflows/server-image.yml | |
| - package.json | |
| - package-lock.json | |
| - apps/terminay-server/** | |
| - packages/server-core/** | |
| - packages/protocol/** | |
| - scripts/ghcr-image.test.mjs | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - "v*.*.*" | |
| paths: | |
| - Dockerfile | |
| - .dockerignore | |
| - .github/workflows/server-image.yml | |
| - package.json | |
| - package-lock.json | |
| - apps/terminay-server/** | |
| - packages/server-core/** | |
| - packages/protocol/** | |
| - scripts/ghcr-image.test.mjs | |
| concurrency: | |
| group: terminay-server-image-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| smoke: | |
| name: Build and smoke server image | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 | |
| with: | |
| persist-credentials: false | |
| - name: Validate image packaging contract | |
| run: node --test scripts/ghcr-image.test.mjs | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3 | |
| - name: Build the repository Dockerfile | |
| run: | | |
| docker buildx build \ | |
| --file ./Dockerfile \ | |
| --tag terminay-server:ci \ | |
| --build-arg OCI_VERSION=ci \ | |
| --build-arg OCI_REVISION="${GITHUB_SHA}" \ | |
| --build-arg OCI_SOURCE="https://github.com/${GITHUB_REPOSITORY}" \ | |
| --load \ | |
| . | |
| - name: Smoke image version and redacted status commands | |
| run: | | |
| docker run --rm terminay-server:ci --version | |
| docker run --rm --read-only --tmpfs /tmp terminay-server:ci \ | |
| --status --data-root /tmp/terminay-status | |
| publish: | |
| name: Publish server image to GHCR | |
| needs: smoke | |
| if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')) }} | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| id-token: write | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 | |
| with: | |
| persist-credentials: false | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3 | |
| - name: Set up multi-architecture emulation | |
| uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3 | |
| - name: Extract image metadata | |
| id: meta | |
| uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5 | |
| with: | |
| images: ghcr.io/${{ github.repository_owner }}/terminay-server | |
| tags: | | |
| type=ref,event=branch | |
| type=semver,pattern={{version}} | |
| type=semver,pattern={{major}}.{{minor}} | |
| type=sha,format=long,prefix=sha- | |
| type=raw,value=latest,enable={{is_default_branch}} | |
| - name: Log in to GHCR | |
| uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and publish signed-attestation image | |
| uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6 | |
| with: | |
| context: . | |
| file: ./Dockerfile | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| build-args: | | |
| OCI_VERSION=${{ steps.meta.outputs.version }} | |
| OCI_REVISION=${{ github.sha }} | |
| OCI_SOURCE=https://github.com/${{ github.repository }} | |
| platforms: linux/amd64,linux/arm64 | |
| provenance: mode=max | |
| sbom: true |