-
Notifications
You must be signed in to change notification settings - Fork 1
70 lines (62 loc) · 2.67 KB
/
Copy pathdocker.yml
File metadata and controls
70 lines (62 loc) · 2.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: Docker Build
on:
push:
branches: [main]
tags: ['v*']
pull_request:
branches: [main]
permissions:
contents: read
packages: write
env:
REGISTRY: ghcr.io
IMAGE: windshiftapp/windshift-agent
# The thin agent image lifts the `ws` CLI from a core-built image. core's
# docker.yml publishes ws-carrier:main on every main push (and :<version>
# on tags), but only :latest on stable releases — so default to :main,
# which always exists. (Renamed from coding-agent-runner in WI-314: the old
# name impersonated the agent image and caused the 2026-06-10 wrong-image
# misconfiguration.) Override via the WS_IMAGE repo/org variable.
WS_IMAGE: ${{ vars.WS_IMAGE || 'ghcr.io/windshiftapp/ws-carrier:main' }}
jobs:
build:
name: Build & publish (windshift-agent)
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
# Log in even on pull_request: the build pulls WS_IMAGE from ghcr.
- name: Log in to Container Registry
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5.10.0
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE }}
tags: |
type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, '-dev') && !contains(github.ref, '-test') && !contains(github.ref, '-rc') }}
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=sha,prefix=
# The agent build cross-compiles via TARGETARCH (CGO off), so a single
# multi-platform buildx pass is cheap — no QEMU for the Go stage. Push
# only off PRs; PRs just validate the build.
- name: Build and push
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6.19.2
with:
context: .
platforms: linux/amd64,linux/arm64
build-args: |
WS_IMAGE=${{ env.WS_IMAGE }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha,scope=windshift-agent
cache-to: type=gha,mode=max,scope=windshift-agent