-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (46 loc) · 1.68 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@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
- name: Container meta for the gRPC utils image
id: container_grpc_utils_meta
uses: docker/metadata-action@69f6fc9d46f2f8bf0d5491e4aabe0bb8c6a4678a # tag=v4
with:
images: |
ghcr.io/${{ github.repository }}-grpc-utils
- name: Set up QEMU
uses: docker/setup-qemu-action@8b122486cedac8393e77aa9734c3528886e4a1a8 # tag=v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@dc7b9719a96d48369863986a06765841d7ea23f6 # tag=v2
- name: Login to GitHub Container Registry
uses: docker/login-action@49ed152c8eca782a232dede0303416e8f356c37b # tag=v2
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@c84f38281176d4c9cdb1626ffafcd6b3911b5d94 # tag=v3
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