Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change in docker context in github actions #490

Merged
merged 12 commits into from
Oct 15, 2024
17 changes: 8 additions & 9 deletions .github/workflows/build-push-ecr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ on:
branches: [ "main" ]

env:
Dockerfile-Backend: Dockerfile
Dockerfile-Web: web/Dockerfile
Dockerfile_Backend: Dockerfile
Dockerfile_Web: web/Dockerfile
jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -21,8 +21,8 @@ jobs:
- name: Setup AWS Creds
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-access-key-id: ${{ secrets.ACCESS_KEY_AWS }}
aws-secret-access-key: ${{ secrets.SECRET_KEY_AWS }}
aws-region: us-west-2

- name: login ECR
Expand All @@ -38,12 +38,12 @@ jobs:
run: |
VERSION_TAG=$(echo "${{ github.ref }}" | cut -d'/' -f 3)
TAG=$ECR_REGISTRY/$ECR_REPOSITORY:${VERSION_TAG}
docker build --platform linux/amd64 --push -t ${TAG} -f ${Dockerfile-Backend} .
docker build --platform linux/amd64 --push -t ${TAG} -f ${{ env.Dockerfile_Backend }} .

- name: Build Backend image
if: github.event_name == 'pull_request'
run: |
docker build --platform linux/amd64 -f ${Dockerfile-Backend} .
docker build --platform linux/amd64 -f ${{ env.Dockerfile_Backend }} .


- name: Build Web and and push
Expand All @@ -54,13 +54,12 @@ jobs:
run: |
VERSION_TAG=$(echo "${{ github.ref }}" | cut -d'/' -f 3)
TAG=$ECR_REGISTRY/$ECR_REPOSITORY:${VERSION_TAG}
docker build --platform linux/amd64 --push -t ${TAG} -f ${Dockerfile-Web} .
docker build --platform linux/amd64 --push -t ${TAG} -f ${{ env.Dockerfile_Web }} web/

- name: Build Web image
if: github.event_name == 'pull_request'
run: |
docker build --platform linux/amd64 -f ${Dockerfile-Web} .

docker build --platform linux/amd64 -f ${{ env.Dockerfile_Web }} web/



Expand Down
Loading