Update Readme.md #3
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: Build and Deploy .NET Core Lambda | |
on: | |
push: | |
paths: | |
- 'Lambdas/GetCharityTypes/**' | |
pull_request: | |
paths: | |
- 'Lambdas/GetCharityTypes/**' | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: '6.0.x' # Specify your .NET Core version | |
- name: Restore dependencies | |
run: | | |
cd Lambdas/GetCharityTypes | |
dotnet restore | |
- name: Build | |
run: dotnet build --configuration Release --no-restore | |
- name: Publish | |
run: dotnet publish -c Release -o ./publish | |
- name: Package Lambda | |
run: | | |
cd publish | |
zip -r ../lambda-package.zip . | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: us-east-1 # Replace with your AWS region | |
- name: Deploy to AWS Lambda | |
run: | | |
aws lambda update-function-code --function-name your-lambda-function-name --zip-file fileb://lambda-package.zip | |
env: | |
AWS_DEFAULT_REGION: us-east-1 # Replace with your AWS region |