-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (46 loc) · 1.66 KB
/
build-grpc-utils-image.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
name: build-grpc-utils-image
on:
push:
branches: [master]
release:
types: [created]
pull_request:
branches: [master]
# Declare default permissions as read only.
permissions: read-all
jobs:
build:
name: build
runs-on: ubuntu-22.04
permissions:
packages: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Container meta for the gRPC utils image
id: container_grpc_utils_meta
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5
with:
images: |
ghcr.io/${{ github.repository }}-grpc-utils
- name: Set up QEMU
uses: docker/setup-qemu-action@5927c834f5b4fdf503fca6f4c7eccda82949e1ee # v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@4fd812986e6c8c2a69e18311145f9371337f27d4 # v3
- name: Login to GitHub Container Registry
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3
if: ${{ github.event_name != 'pull_request' }}
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push gRPC utils image
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5
with:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.container_grpc_utils_meta.outputs.tags }}
labels: ${{ steps.container_grpc_utils_meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
file: grpc-utils.Dockerfile