-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlambda-build.yaml
More file actions
58 lines (50 loc) · 1.31 KB
/
lambda-build.yaml
File metadata and controls
58 lines (50 loc) · 1.31 KB
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
name: Build and Deploy
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
permissions:
id-token: write
contents: read
pull-requests: write
jobs:
test:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
run: npm install
- name: Run tests
run: npm test
build:
uses: dnd-it/github-workflows/.github/workflows/lambda-nodejs.yaml@v1
with:
node_version: "20"
source_dir: src/lambda
plan:
if: github.event_name == 'pull_request'
needs: [build]
strategy:
fail-fast: false
matrix:
environment: [dev, prod]
uses: dnd-it/github-workflows/.github/workflows/tf-plan.yaml@v1
with:
environment: ${{ matrix.environment }}
gh_artifact_name: artifact
apply:
if: github.ref_name == github.event.repository.default_branch && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
needs: [build]
strategy:
fail-fast: true
max-parallel: 1
matrix:
environment: [dev, prod]
uses: dnd-it/github-workflows/.github/workflows/tf-apply.yaml@v1
with:
environment: ${{ matrix.environment }}
gh_artifact_name: artifact