Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 33 additions & 4 deletions .github/workflows/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,37 @@ jobs:
# Both legs live in wanaware-infrastructure. CI plumbing (WIF identifiers,
# registry host, GH_ACCESS_TOKEN) comes from the runner's Keeper-backed
# ci-workload env; nothing is a GitHub secret.
# ARC runners build through the pod's rootless BuildKit sidecar ($BUILDKIT_HOST):
# no Docker daemon and nothing privileged. A non-ARC runner (the runner_label
# escape hatch) has no sidecar and gets buildx's default driver instead.
Comment thread
muhammad-tahir-nawaz marked this conversation as resolved.
Resolved
- name: Select the image builder
if: ${{ inputs.deploy_type != 'release-only' }}
id: builder
run: |
if [ -n "${BUILDKIT_HOST:-}" ]; then
echo "driver=remote" >> "$GITHUB_OUTPUT"
echo "endpoint=$BUILDKIT_HOST" >> "$GITHUB_OUTPUT"
else
echo "driver=docker-container" >> "$GITHUB_OUTPUT"
fi

- name: Set up the image builder
if: ${{ inputs.deploy_type != 'release-only' }}
uses: docker/setup-buildx-action@v3
Comment thread
muhammad-tahir-nawaz marked this conversation as resolved.
Resolved
with:
driver: ${{ steps.builder.outputs.driver }}
endpoint: ${{ steps.builder.outputs.endpoint }}

# Built to a tarball rather than loaded into a daemon: Trivy scans the file, and
# only a clean image is pushed (the push step rebuilds from the warm cache).
- name: Build Docker image
if: ${{ inputs.deploy_type != 'release-only' }}
id: build
uses: docker/build-push-action@v4
with:
context: ${{ inputs.docker_context }}
file: ${{ inputs.docker_context }}/${{ inputs.dockerfile_path }}
push: false
load: true
outputs: type=docker,dest=${{ runner.temp }}/image.tar
tags: ${{ env.GCP_REGISTRY }}/${{ env.GCP_PROJECT }}/${{ inputs.image_path }}:latest
build-args: |
GH_ACCESS_TOKEN=${{ env.GH_ACCESS_TOKEN }}
Expand All @@ -149,15 +171,22 @@ jobs:
uses: aquasecurity/trivy-action@v0.36.0
with:
scan-type: "image"
image-ref: ${{ env.GCP_REGISTRY }}/${{ env.GCP_PROJECT }}/${{ inputs.image_path }}:latest
input: ${{ runner.temp }}/image.tar
ignore-unfixed: true
format: "table"
severity: "CRITICAL,HIGH"
exit-code: "1"

- name: Push Docker image
if: ${{ inputs.deploy_type != 'release-only' }}
run: docker push ${{ env.GCP_REGISTRY }}/${{ env.GCP_PROJECT }}/${{ inputs.image_path }}:latest
uses: docker/build-push-action@v4
Comment thread
muhammad-tahir-nawaz marked this conversation as resolved.
Resolved
with:
context: ${{ inputs.docker_context }}
file: ${{ inputs.docker_context }}/${{ inputs.dockerfile_path }}
push: true
Comment thread
muhammad-tahir-nawaz marked this conversation as resolved.
Resolved
tags: ${{ env.GCP_REGISTRY }}/${{ env.GCP_PROJECT }}/${{ inputs.image_path }}:latest
build-args: |
GH_ACCESS_TOKEN=${{ env.GH_ACCESS_TOKEN }}

# --- GKE deploy ---
- name: Get GKE Credentials
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/shared-registry-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,27 @@ jobs:
continue-on-error: true
run: echo "value=$(date -u +%Y%m%d%H%M)" >> "$GITHUB_OUTPUT"

# ARC runners build through the pod's rootless BuildKit sidecar ($BUILDKIT_HOST):
# no Docker daemon and nothing privileged. A non-ARC runner (the runner_label
# escape hatch) has no sidecar and gets buildx's default driver instead.
Comment thread
muhammad-tahir-nawaz marked this conversation as resolved.
Resolved
- name: Select the image builder
continue-on-error: true
id: builder
run: |
if [ -n "${BUILDKIT_HOST:-}" ]; then
echo "driver=remote" >> "$GITHUB_OUTPUT"
echo "endpoint=$BUILDKIT_HOST" >> "$GITHUB_OUTPUT"
else
echo "driver=docker-container" >> "$GITHUB_OUTPUT"
fi

- name: Set up the image builder
continue-on-error: true
uses: docker/setup-buildx-action@v3
Comment thread
muhammad-tahir-nawaz marked this conversation as resolved.
Resolved
with:
driver: ${{ steps.builder.outputs.driver }}
endpoint: ${{ steps.builder.outputs.endpoint }}

- name: Build and push image to GCP Shared Registry
id: build_push
continue-on-error: true
Expand Down
Loading