-
Notifications
You must be signed in to change notification settings - Fork 66
71 lines (62 loc) · 1.76 KB
/
_build_image.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
60
61
62
63
64
65
66
67
68
69
70
71
name: Build image
permissions:
contents: read
on:
workflow_call:
secrets:
dockerhub_username:
dockerhub_password:
gcp_key:
inputs:
image_prefix:
type: string
default: envoyproxy/envoy-build-
os_family:
type: string
default: linux
distro:
type: string
required: true
host_platform:
type: string
default: ubuntu-22.04
go_version:
type: string
default: '1.16'
gcr_push:
type: boolean
default: false
gcr_name:
type: string
default:
jobs:
image:
runs-on: ${{ inputs.host_platform }}
name: Build and test Docker image
steps:
- uses: envoyproxy/toolshed/gh-actions/[email protected]
name: 'Free disk space'
- name: 'Checkout repository'
uses: actions/checkout@v4
- run: |
CONTAINER_TAG=$(git log -1 --pretty=format:"%H" "./docker")
echo "tag=${CONTAINER_TAG}" >> "$GITHUB_OUTPUT"
id: container
shell: bash
name: Container hash
- run: |
cd docker
./push.sh
name: Build (${{ inputs.image_prefix }}${{ inputs.distro }}@${{ steps.container.outputs.tag }})
shell: bash
env:
OS_FAMILY: ${{ inputs.os_family }}
SOURCE_BRANCH: ${{ github.ref }}
DOCKERHUB_USERNAME: ${{ secrets.dockerhub_username }}
DOCKERHUB_PASSWORD: ${{ secrets.dockerhub_password }}
GCP_SERVICE_ACCOUNT_KEY: ${{ secrets.gcp_key }}
IMAGE_PREFIX: ${{ inputs.image_prefix }}
OS_DISTRO: ${{ inputs.distro }}
PUSH_GCR_IMAGE: ${{ inputs.gcr_push }}
GCR_IMAGE_NAME: ${{ inputs.gcr_name }}
LOAD_IMAGE: ${{ github.event_name == 'pull_request' && 'true' || 'false' }}