Release serverless-init #47
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |