-
-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (56 loc) · 1.79 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
name: build
on:
push:
branches:
- main
workflow_dispatch:
env:
PUBSUB_EMULATOR_BUILD_NUMBER: "20241025173437"
jobs:
build:
runs-on: ubuntu-22.04
permissions:
contents: read
packages: write
id-token: write
steps:
# https://github.com/actions/checkout
- name: Checkout branch
uses: actions/checkout@v4
# https://github.com/crazy-max/ghaction-github-runtime
- name: Expose GitHub Runtime for buildkit gha cache
uses: crazy-max/ghaction-github-runtime@v3
# https://github.com/docker/login-action#github-container-registry
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
with:
version: latest
driver-opts: |
image=moby/buildkit:latest
network=host
platforms: |
linux/amd64
linux/arm64
buildkitd-flags: --debug
# https://github.com/docker/build-push-action
- name: Build and push
uses: docker/build-push-action@v5
with:
build-args: |
PUBSUB_EMULATOR_BUILD_NUMBER=${{ env.PUBSUB_EMULATOR_BUILD_NUMBER }}
builder: ${{ steps.buildx.outputs.name }}
cache-from: type=gha
cache-to: type=gha,mode=max
context: .
outputs: type=registry
platforms: linux/amd64,linux/arm64
tags: ghcr.io/containerz-dev/cloud-pubsub-emulator:${{ env.PUBSUB_EMULATOR_BUILD_NUMBER }}
target: cloud-pubsub-emulator