From 99fcb3fe880df6e9f80aa6a6de4b899b9e62420b Mon Sep 17 00:00:00 2001 From: Neumann Date: Thu, 14 Dec 2023 17:46:23 +0100 Subject: [PATCH 1/2] Only deploy on master --- .github/workflows/CD.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/CD.yml b/.github/workflows/CD.yml index 356b86a..f0088e2 100644 --- a/.github/workflows/CD.yml +++ b/.github/workflows/CD.yml @@ -45,18 +45,22 @@ jobs: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v1 + if: github.ref == 'refs/heads/master' with: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws-region: eu-central-1 - name: Deploy to AWS Lambda + if: github.ref == 'refs/heads/master' run: | aws lambda update-function-code --function-name ${{ matrix.project }} --zip-file fileb://./${{ matrix.project }}.zip - name: Wait for deployment to complete + if: github.ref == 'refs/heads/master' run: sleep 30 - name: Update function configuration + if: github.ref == 'refs/heads/master' run: | aws lambda update-function-configuration --function-name ${{ matrix.project }} --handler $ProjectBasePath.${{ matrix.project }}::$ProjectBasePath.${{ matrix.project }}.Function::FunctionHandler --environment 'Variables={AwsAccessKey=${{ secrets.AWS_ACCESS_KEY_ID }},AwsSecretKey=${{ secrets.AWS_SECRET_ACCESS_KEY }},AwsBucketName=${{ secrets.AwsBucketName }},AwsRegion=${{ secrets.AwsRegion }},EmailAddresses=${{ secrets.EmailAddresses }},RiotGamesApiKey=${{ secrets.RiotGamesApiKey }},PlatformRoute=${{ secrets.PlatformRoute }},RegionalRoute=${{ secrets.RegionalRoute }},SummonerNames=${{ secrets.SummonerNames }}}' --timeout 30 From 87bf6f0ffbffcd57b2be3f228908caba707ae5ae Mon Sep 17 00:00:00 2001 From: Neumann Date: Thu, 14 Dec 2023 17:49:44 +0100 Subject: [PATCH 2/2] Build on OR --- .github/workflows/CD.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CD.yml b/.github/workflows/CD.yml index f0088e2..9f551f0 100644 --- a/.github/workflows/CD.yml +++ b/.github/workflows/CD.yml @@ -1,6 +1,6 @@ name: Build, Test, Package and ZIP .NET 6 Lambda Functions -on: [push] +on: [push, pull_request] jobs: build: