-
Notifications
You must be signed in to change notification settings - Fork 5
102 lines (91 loc) · 3.11 KB
/
release-serverless-init.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: Release serverless-init
on:
workflow_dispatch:
inputs:
buildTags:
type: choice
description: Build tags
default: "serverless otlp"
options:
- "serverless otlp"
- "serverless"
tag:
type: string
description: Docker image tag name, eg. (beta11, beta12-rc1, etc.)
latestTag:
type: choice
description: Additionally, tag this as latest? Only use this if releasing a new production version.
default: "no"
options:
- "yes"
- "no"
agentVersion:
type: string
description: Datadog agent version
agentBranch:
type: string
description: Datadog agent branch name (default main)
default: "main"
env:
IMAGE_NAME: datadog/datadog-lambda-extension/serverless-init
REGISTRY: ghcr.io
jobs:
release-serverless-init:
runs-on: ubuntu-latest
strategy:
matrix:
arrays: [
{dockerFile: "Dockerfile.serverless-init.build", isAlpine: "false", tagSuffix: ""},
{dockerFile: "Dockerfile.serverless-init.alpine.build", isAlpine: "true", tagSuffix: "-alpine"}
]
name: "Release Serverless Init (isAlpine: ${{ matrix.arrays.isAlpine }})"
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
repository: DataDog/datadog-agent
ref: refs/heads/${{ github.event.inputs.agentBranch }}
path: datadog-agent
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build binaries
working-directory: ./scripts
run: ./build_serverless_init.sh
env:
AGENT_PATH: datadog-agent
VERSION: ${{ github.event.inputs.tag }}
SERVERLESS_INIT: true
ALPINE: ${{ matrix.arrays.isAlpine }}
AGENT_VERSION: ${{ github.event.inputs.agentVersion }}
- name: Set up build directory and copy binaries
run: |
cp -r .layers/. ./scripts/bin/
- name: Login to GHCR
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v4
with:
context: ./scripts
file: ./scripts/${{ matrix.arrays.dockerFile }}
push: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.event.inputs.tag }}${{ matrix.arrays.tagSuffix }}
provenance: false
platforms: linux/amd64,linux/arm64
- name: Build and push latest
id: docker_build_latest
uses: docker/build-push-action@v4
if: ${{ github.event.inputs.latestTag == 'yes' }}
with:
context: ./scripts
file: ./scripts/${{ matrix.arrays.dockerFile }}
push: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest${{ matrix.arrays.tagSuffix }}
provenance: false
platforms: linux/amd64,linux/arm64