Skip to content

Commit 10b02d9

Browse files
authored
Merge pull request #1 from newrelic/NR-328236-github-actions
ci: updated workflows for pull request and merge to main
2 parents 26a1823 + 27e1735 commit 10b02d9

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed

.github/workflows/pull_request.yaml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Pull Request Workflow
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
validate-template-code:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Install AWS SAM CLI
17+
run: |
18+
pip install --user aws-sam-cli
19+
20+
- name: Validate SAM Templates
21+
run: |
22+
find . -path "./.github" -prune -o \( -name "*.yaml" -o -name "*.yml" \) -print0 | while IFS= read -r -d '' template; do
23+
echo "Validating template: $template"
24+
sam validate --template-file "$template" --region us-east-2 --lint
25+
done
26+
shell: bash

.github/workflows/release.yaml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Build and Deploy AWS Unified Firehose
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build-and-deploy:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
id-token: write
13+
contents: write
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Configure AWS Credentials
19+
uses: aws-actions/configure-aws-credentials@v3
20+
with:
21+
role-to-assume: ${{ secrets.AWS_SAR_PUBLISHER_ROLE }}
22+
aws-region: us-east-2
23+
24+
- name: Install AWS SAM CLI
25+
run: |
26+
pip install aws-sam-cli
27+
28+
- name: Build SAM Application
29+
run: sam build --template-file firehose-template.yaml --region us-east-2
30+
31+
- name: Package SAM Application
32+
run: sam package --s3-bucket unified-lambda-cft-1 --output-template-file firehose-template.yaml --region us-east-2
33+
34+
- name: Upload CloudFormation Template to S3
35+
run: aws s3 cp firehose-template.yaml s3://unified-lambda-serverless-1/firehose-template.yaml

0 commit comments

Comments
 (0)