Skip to content

Commit 4096318

Browse files
authored
ci: Add workflow to publish built layers as artifacts (#750)
* Add workflow to publish built layers as artifacts * Pin Github Actions
1 parent 1030376 commit 4096318

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

.github/workflows/build_layer.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Build Layers for System Tests
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- "main"
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
node_version: ["18.12", "20.19", "22.11", "24.11"]
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
21+
22+
- name: Build layer for Node ${{ matrix.node_version }}
23+
run: |
24+
NODE_MAJOR=$(echo "${{ matrix.node_version }}" | cut -d '.' -f 1)
25+
temp_dir=$(mktemp -d)
26+
docker buildx build -t datadog-lambda-layer-node:${{ matrix.node_version }} . --no-cache \
27+
--build-arg image=node:${NODE_MAJOR}-bullseye --progress=plain -o $temp_dir/nodejs
28+
mkdir -p .layers
29+
(cd $temp_dir && zip -q -r $GITHUB_WORKSPACE/.layers/datadog_lambda_node${{ matrix.node_version }}.zip ./)
30+
rm -rf $temp_dir
31+
32+
- name: Upload layer artifact
33+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
34+
with:
35+
path: .layers/datadog_lambda_node${{ matrix.node_version }}.zip
36+
name: datadog_lambda_node${{ matrix.node_version }}

0 commit comments

Comments
 (0)