Skip to content

Commit

Permalink
Update for force update ECS service.
Browse files Browse the repository at this point in the history
  • Loading branch information
wspooong committed Mar 27, 2024
1 parent e8766ff commit cdd0eb4
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/aws.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,6 @@ jobs:
with:
envkey_VITE_API_URL: ${{ secrets.VITE_API_URL }}

# - name: Get current time
# uses: josStorer/[email protected]
# id: current-time
# with:
# format: YYYYMMDD-HHmmSS
# utcOffset: "+08:00"

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
Expand All @@ -47,7 +40,6 @@ jobs:
id: build-image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
# IMAGE_TAG: ${{ steps.current-time.outputs.formattedTime }}
IMAGE_TAG: production
run: |
# Build a docker container and
Expand All @@ -56,3 +48,12 @@ jobs:
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
echo "image=$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" >> $GITHUB_OUTPUT
- name: Update ECS service
id: update-ecs-service
run: |
aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY_ID }}
aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws configure set default.region ${{ secrets.AWS_REGION }}
aws ecs update-service --cluster ${{ secrets.ECS_CLUSTER }} --service ${{ secrets.ECS_SERVICE_NAME }} --force-new-deployment

0 comments on commit cdd0eb4

Please sign in to comment.