From d9c8e7907c8864dff1894d61991ac3a1f29b5195 Mon Sep 17 00:00:00 2001 From: Dan Diggas <78769670+Dandiggas@users.noreply.github.com> Date: Mon, 30 Oct 2023 19:11:32 +0000 Subject: [PATCH] Create frontend.yml --- .github/workflows/frontend.yml | 43 ++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/frontend.yml diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml new file mode 100644 index 0000000..3aab97f --- /dev/null +++ b/.github/workflows/frontend.yml @@ -0,0 +1,43 @@ +name: Deploy to ECR + +on: + + push: + branches: [ main ] + +jobs: + + build: + + name: Build Image + runs-on: ubuntu-latest + + + steps: + + - name: Check out code + uses: actions/checkout@v2 + + - 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 + + - name: Login to Amazon ECR Public + id: login-ecr-public + uses: aws-actions/amazon-ecr-login@v2 + with: + registry-type: public + + + - name: Build, tag, and push image to Amazon ECR + env: + REGISTRY: ${{ steps.login-ecr-public.outputs.registry }} + REGISTRY_ALIAS: diggas + REPOSITORY: frontend + IMAGE_TAG: ${{ github.sha }} + run: | + docker build -t $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG -f ./todolist-app/Dockerfile . + docker push $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG