Skip to content

Commit

Permalink
feat: add wait for service to run
Browse files Browse the repository at this point in the history
  • Loading branch information
abelr20 committed Aug 22, 2024
1 parent 28893a4 commit 1bee0ed
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/aws.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ jobs:
# Enable error handling
set -e
set -o pipefail
# Use Docker Buildx to build the image for x86_64
docker buildx build --platform linux/amd64 --push -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
echo "image=$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" >> $GITHUB_OUTPUT
Expand All @@ -59,5 +60,11 @@ jobs:
# Enable error handling
set -e
set -o pipefail
# Update the ECS service
aws ecs update-service --cluster ${{ env.ECS_CLUSTER }} --service ${{ env.ECS_SERVICE }} --force-new-deployment
# Wait until the service has stabilized (new tasks running, old tasks stopped)
aws ecs wait services-stable --cluster ${{ env.ECS_CLUSTER }} --services ${{ env.ECS_SERVICE }}
echo "Deployment successful and service is stable."
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ WORKDIR /usr/src/app
COPY package*.json ./

# Install dependencies
RUN npm install -g npm@latest && npm install
RUN npm install -g npm@latest
RUN npm install

# Copy the rest of the application code
COPY ./client ./client
COPY ./server ./server

# Build the client and server
# Build the server and client
RUN npm run build:server
RUN npm run build:prd

Expand Down
2 changes: 1 addition & 1 deletion client/src/features/homepage/HomePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const HomePage: React.FC = () => {
<div className='login-button-container'>
<div className='HpHeader'>
<h1> Welcome to SkyScraper </h1>
<h2> CI/CD 2 </h2>
<h2> CI/CD </h2>
</div>
<div className='LoginButtonWrapper'>
{' '}
Expand Down

0 comments on commit 1bee0ed

Please sign in to comment.