Merge pull request #4 from PropertyControl360/Dev #4
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: CI-CD Pipeline for UAT | |
on: | |
push: | |
branches: [ "UAT", "Dev" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the code | |
uses: actions/checkout@v4 | |
- name: Configure AWS ECR User Credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
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: Login to Amazon ECR | |
id: login-ecr | |
uses: aws-actions/amazon-ecr-login@v2 | |
- name: Build, tag, and push image to Amazon ECR | |
run: | | |
docker_tag="${GITHUB_REF_NAME}-${GITHUB_SHA:0:7}" | |
docker build -t propertycontrol-admin-dashboard . | |
docker tag propertycontrol-admin-dashboard:latest 281729579533.dkr.ecr.eu-central-1.amazonaws.com/propertycontrol-admin-dashboard:${docker_tag} | |
docker push 281729579533.dkr.ecr.eu-central-1.amazonaws.com/propertycontrol-admin-dashboard:${docker_tag} | |