Skip to content

chore: update pipeline #14

chore: update pipeline

chore: update pipeline #14

Workflow file for this run

name : lambda-deploy
on:
push:
branches:
- dev
- qa
env:
change_flag: false
jobs:
check-for-change:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Check for changes in lambda-1
id: lambda-1
uses: yumemi-inc/path-filter@v2
with:
patterns: 'lambda-1/**'
run: |
echo "change_list=lambda-1" >> $GITHUB_ENV
echo "change_flag=true" >> $GITHUB_ENV
- name: Check for changes in lambda-2
id: lambda-2
uses: yumemi-inc/path-filter@v2
with:
patterns: 'lambda-2/**'
run: |

Check failure on line 30 in .github/workflows/main.yml

View workflow run for this annotation

GitHub Actions / lambda-deploy

Invalid workflow file

The workflow is not valid. .github/workflows/main.yml (Line: 30, Col: 16): Unrecognized named-value: 'change_list'. Located at position 1 within expression: change_list .github/workflows/main.yml (Line: 37, Col: 9): Unrecognized named-value: 'env'. Located at position 1 within expression: env.change_flag
change_list = "${change_list}|lambda-2"
echo "change_flag=true" >> $GITHUB_ENV
echo "${{ change_list }}"
echo "${{ change_flag }}"
lambda-deploy-all:
needs: [check-for-change]
if: ${{ env.change_flag }}
strategy:
matrix:
label: [lambda-1, lambda-2]
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Configure AWS
uses: aws-actions/configure-aws-credentials@v4.0.2
with:
role-to-assume: arn:aws:iam::949263681218:role/ankit-oidc-role
aws-region: us-east-1
- name: Set stage
run: |
if [[ $GITHUB_REF == refs/heads/dev ]]; then
echo "STAGE=dev" >> $GITHUB_ENV
elif [[ $GITHUB_REF == refs/heads/qa ]]; then
echo "STAGE=qa" >> $GITHUB_ENV
fi
- name: Deploy lambda
run: |
cd ${{ matrix.label }}
zip -r lambda_zip.zip *
aws lambda update-function-code --function-name "${{ matrix.label }}-$STAGE" --zip-file fileb://./lambda_zip.zip