From 2b14d705384f5e3d9629319e4bd2587034147b14 Mon Sep 17 00:00:00 2001 From: Alex Hyett Date: Mon, 10 Jul 2023 14:20:46 +0100 Subject: [PATCH] Add push to ECR --- .github/workflows/build-and-test.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 5a2a305..23abfbe 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -1,4 +1,4 @@ -name: Build and Test +name: Build, Test and Push on: [push] @@ -48,4 +48,13 @@ jobs: with: name: Test Results path: TestResults/*.trx - reporter: dotnet-trx \ No newline at end of file + reporter: dotnet-trx + - name: Push to ECR + if: github.ref == 'refs/heads/main' + id: ecr + uses: jwalton/gh-ecr-push@v1 + with: + access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + region: us-east-1 + image: githubactionsdemo.api:${{ steps.gitversion.outputs.nuGetVersion }} \ No newline at end of file