-
Notifications
You must be signed in to change notification settings - Fork 70
59 lines (51 loc) · 1.91 KB
/
gcp-publish.yml
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
name: Build and publish google cloud dependency
on:
workflow_dispatch:
inputs:
name:
description: "Build and publish an fbpcf/google-cloud-cpp image for a particular version"
default: "Run"
gcp_release:
description: "The gcp version to build and publish (e.g. 1.32.1)"
required: true
type: string
os:
description: "Which os to use. Currently only supports ubuntu"
required: false
type: str
default: "ubuntu"
os_release:
description: "The os version to use (e.g. 20.04 for ubuntu)"
required: false
type: str
default: "20.04"
env:
REGISTRY: ghcr.io
jobs:
ubuntu:
runs-on: [self-hosted, e2e_test_runner]
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v2
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build image
run: |
docker build \
--build-arg os_release=${{ github.event.inputs.os_release }} \
--build-arg gcp_cpp_release=${{ github.event.inputs.gcp_release }} \
-t "fbpcf/${{ github.event.inputs.os }}-google-cloud-cpp:${{ github.event.inputs.gcp_release }}" \
-f "docker/google-cloud-cpp/Dockerfile.${{ github.event.inputs.os }}" .
- name: Tag image
run: |
docker tag fbpcf/${{ github.event.inputs.os }}-google-cloud-cpp:${{ github.event.inputs.gcp_release }} \
${{ env.REGISTRY }}/${{ github.repository }}/${{ github.event.inputs.os }}-google-cloud-cpp:${{ github.event.inputs.gcp_release }}
- name: Publish image
run: |
docker push --all-tags ${{ env.REGISTRY }}/${{ github.repository }}/${{ github.event.inputs.os }}-google-cloud-cpp