Skip to content

Commit

Permalink
add docker testing to workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
amirrr committed Jan 17, 2025
1 parent f7be726 commit e0df9a9
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/test-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Test Docker Containerization

on: [push]

env:
ECR_REPOSITORY_BACKEND: atlas-backend
ECR_REPOSITORY_FRONTEND: atlas-frontend

jobs:
frontend-container:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Build, tag, and push frontend image to Amazon ECR
id: build-front-image
env:
ECR_REGISTRY: atlas-ecr-registry
IMAGE_TAG: ${{ github.sha }}
run: |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY_FRONTEND:$IMAGE_TAG -f Dockerfile.client .
docker push $ECR_REGISTRY/$ECR_REPOSITORY_FRONTEND:$IMAGE_TAG
echo "image=$ECR_REGISTRY/$ECR_REPOSITORY_FRONTEND:$IMAGE_TAG" >> $GITHUB_OUTPUT
backend-container:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Build, tag, and push backend image to Amazon ECR
id: build-backend-image
env:
ECR_REGISTRY: atlas-ecr-registry
IMAGE_TAG: ${{ github.sha }}
run: |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY_BACKEND:$IMAGE_TAG -f Dockerfile.server .
docker push $ECR_REGISTRY/$ECR_REPOSITORY_BACKEND:$IMAGE_TAG
echo "image=$ECR_REGISTRY/$ECR_REPOSITORY_BACKEND:$IMAGE_TAG" >> $GITHUB_OUTPUT

0 comments on commit e0df9a9

Please sign in to comment.