Merge pull request #179 from meroton/disable-grpc-refetch #9
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
| { | |
| "jobs": { | |
| "publish_backend": { | |
| "name": "Publish Backend (Bazel)", | |
| "runs-on": "ubuntu-24.04-arm", | |
| "steps": [ | |
| { | |
| "name": "Check out source code", | |
| "uses": "actions/checkout@v4" | |
| }, | |
| { | |
| "env": { | |
| "GITHUB_TOKEN": "${{ secrets.GITHUB_TOKEN }}" | |
| }, | |
| "name": "Install Docker credentials", | |
| "run": "echo \"${GITHUB_TOKEN}\" | docker login ghcr.io -u $ --password-stdin" | |
| }, | |
| { | |
| "name": "Installing Bazel", | |
| "run": "v=$(cat .bazelversion)\nmkdir -p ~/bin\ncurl -L https://github.com/bazelbuild/bazel/releases/download/${v}/bazel-${v}-linux-arm64 > ~/bin/bazel\nchmod +x ~/bin/bazel\necho ~/bin >> ${GITHUB_PATH}\n", | |
| "shell": "bash" | |
| }, | |
| { | |
| "name": "Build and push backend", | |
| "run": "bazel run --stamp //cmd/bb_portal:bb_portal_container_push" | |
| } | |
| ] | |
| }, | |
| "publish_frontend_images": { | |
| "name": "Build Frontend (${{ matrix.arch }})", | |
| "runs-on": "${{ matrix.runner }}", | |
| "steps": [ | |
| { | |
| "name": "Check out source code", | |
| "uses": "actions/checkout@v4" | |
| }, | |
| { | |
| "env": { | |
| "GITHUB_TOKEN": "${{ secrets.GITHUB_TOKEN }}" | |
| }, | |
| "name": "Install Docker credentials", | |
| "run": "echo \"${GITHUB_TOKEN}\" | docker login ghcr.io -u $ --password-stdin" | |
| }, | |
| { | |
| "name": "Set tag variables", | |
| "run": "echo \"TIMESTAMP=$(TZ=UTC date --date \"@$(git show -s --format=%ct HEAD)\" +%Y%m%dT%H%M%SZ)\" >> $GITHUB_ENV\necho \"SHA_SHORT=$(git rev-parse --short HEAD)\" >> $GITHUB_ENV\n" | |
| }, | |
| { | |
| "name": "Build and push variant", | |
| "uses": "docker/build-push-action@v4", | |
| "with": { | |
| "context": "frontend", | |
| "file": "./frontend/Dockerfile", | |
| "push": true, | |
| "tags": "ghcr.io/buildbarn/bb-portal-frontend:${{ env.TIMESTAMP }}-${{ env.SHA_SHORT }}-${{ matrix.arch }}" | |
| } | |
| } | |
| ], | |
| "strategy": { | |
| "matrix": { | |
| "include": [ | |
| { | |
| "arch": "arm64", | |
| "runner": "ubuntu-24.04-arm" | |
| }, | |
| { | |
| "arch": "amd64", | |
| "runner": "ubuntu-24.04" | |
| } | |
| ] | |
| } | |
| } | |
| }, | |
| "publish_frontend_manifest": { | |
| "name": "Merge Frontend Manifest", | |
| "needs": [ | |
| "publish_frontend_images" | |
| ], | |
| "runs-on": "ubuntu-24.04-arm", | |
| "steps": [ | |
| { | |
| "name": "Check out source code", | |
| "uses": "actions/checkout@v4" | |
| }, | |
| { | |
| "env": { | |
| "GITHUB_TOKEN": "${{ secrets.GITHUB_TOKEN }}" | |
| }, | |
| "name": "Install Docker credentials", | |
| "run": "echo \"${GITHUB_TOKEN}\" | docker login ghcr.io -u $ --password-stdin" | |
| }, | |
| { | |
| "name": "Set tag variables", | |
| "run": "echo \"TIMESTAMP=$(TZ=UTC date --date \"@$(git show -s --format=%ct HEAD)\" +%Y%m%dT%H%M%SZ)\" >> $GITHUB_ENV\necho \"SHA_SHORT=$(git rev-parse --short HEAD)\" >> $GITHUB_ENV\n" | |
| }, | |
| { | |
| "name": "Create and Push Manifest", | |
| "run": "# Base image name\nIMAGE=\"ghcr.io/buildbarn/bb-portal-frontend\"\nTAG=\"${{ env.TIMESTAMP }}-${{ env.SHA_SHORT }}\"\n\n# Create a manifest list (a \"virtual\" image) that points to both arch-specific images\ndocker buildx imagetools create -t ${IMAGE}:${TAG} \\\n ${IMAGE}:${TAG}-amd64 \\\n ${IMAGE}:${TAG}-arm64\n" | |
| } | |
| ] | |
| } | |
| }, | |
| "name": "Build and publish docker images", | |
| "on": { | |
| "push": { | |
| "branches": [ | |
| "main" | |
| ] | |
| }, | |
| "workflow_dispatch": null | |
| }, | |
| "permissions": { | |
| "contents": "read", | |
| "packages": "write" | |
| } | |
| } |