-
Notifications
You must be signed in to change notification settings - Fork 1.1k
72 lines (71 loc) · 2.08 KB
/
build.yaml
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
71
72
env:
REGISTRY: ghcr.io/anthropics/anthropic-quickstarts
name: build
on:
pull_request:
paths:
- .github/**
- computer-use-demo/**
push:
branches:
- main
paths:
- .github/**
- computer-use-demo/**
jobs:
build-amd64:
uses: ./.github/workflows/reusable_build_step.yaml
with:
platform: amd64
builder: ubuntu-latest-16core
registry: ghcr.io/anthropics/anthropic-quickstarts
tag_prefix: computer-use-demo-
context: computer-use-demo
permissions:
contents: read
packages: write
build-arm64:
uses: ./.github/workflows/reusable_build_step.yaml
with:
platform: arm64
builder: ubuntu-22.04-arm64-16core
registry: ghcr.io/anthropics/anthropic-quickstarts
tag_prefix: computer-use-demo-
context: computer-use-demo
permissions:
contents: read
packages: write
merge:
runs-on: ubuntu-latest
needs:
- build-arm64
- build-amd64
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Login to ghcr.io
uses: docker/#-action@v3
with:
registry: ghcr.io
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Set image tag
run: |
echo "SHORT_SHA=$(git rev-parse --short ${{ github.sha }})" >> "$GITHUB_ENV"
- name: Create SHA manifest and push
run: |
docker buildx imagetools create -t \
${REGISTRY}:computer-use-demo-${SHORT_SHA} \
${REGISTRY}:computer-use-demo-${SHORT_SHA}-amd64 \
${REGISTRY}:computer-use-demo-${SHORT_SHA}-arm64
- name: Create latest manifest and push
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
docker buildx imagetools create -t \
${REGISTRY}:computer-use-demo-latest \
${REGISTRY}:computer-use-demo-latest-amd64 \
${REGISTRY}:computer-use-demo-latest-arm64