Skip to content
Merged

ci #24

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/deploy-frontend-ecs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Deploy front end (ECS force new deployment)

on:
workflow_dispatch:
# push:
# branches:
# - "master"

permissions:
id-token: write
contents: read

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Configure AWS credentials (OIDC)
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{secrets.AWS_ROLE_TO_ASSUME}}
aws-region: ${{vars.AWS_REGION}}

- name: Force new deployment (frontend)
env:
AWS_PAGER: ""
run: |
aws ecs update-service \
--cluster cre-examples-cluster \
--service cre-examples-frontend \
Comment on lines +28 to +29
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cluster name and service name are hardcoded. These should be parameterized using GitHub variables (similar to how AWS_REGION is handled) to improve maintainability and allow easier configuration changes without modifying the workflow file. Consider using ${{vars.AWS_ECS_CLUSTER}} and ${{vars.AWS_ECS_SERVICE_FRONTEND}} or similar variable names.

Suggested change
--cluster cre-examples-cluster \
--service cre-examples-frontend \
--cluster ${{vars.AWS_ECS_CLUSTER}} \
--service ${{vars.AWS_ECS_SERVICE_FRONTEND}} \

Copilot uses AI. Check for mistakes.
--force-new-deployment \
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workflow lacks error handling and validation for the ECS deployment. The aws ecs update-service command can fail for various reasons (service not found, insufficient permissions, cluster not available), but there's no mechanism to detect or report these failures effectively. Consider adding validation checks or at least a step to verify the deployment status after forcing the new deployment, such as using aws ecs wait services-stable.

Suggested change
--force-new-deployment \
--force-new-deployment \
--region ${{vars.AWS_REGION}}
- name: Wait for ECS service to become stable (frontend)
env:
AWS_PAGER: ""
run: |
aws ecs wait services-stable \
--cluster cre-examples-cluster \
--services cre-examples-frontend \

Copilot uses AI. Check for mistakes.
--region ${{vars.AWS_REGION}}
Comment on lines +30 to +31
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The --region flag in the AWS CLI command is redundant because the region is already configured in the AWS credentials setup step (line 21). When credentials are configured with aws-region, all subsequent AWS CLI commands in that job will use that region automatically. Removing this redundant flag would make the code cleaner and avoid potential confusion if the two region values ever differ.

Suggested change
--force-new-deployment \
--region ${{vars.AWS_REGION}}
--force-new-deployment

Copilot uses AI. Check for mistakes.
Comment on lines +20 to +31
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing consistent spacing in the GitHub expressions. Throughout this file, expressions like ${{secrets.AWS_ROLE_TO_ASSUME}} don't have spaces around the content. However, looking at other workflow files in the repository (e.g., docker-fe.yml lines 32-33, 41-42), the convention is to use spaces: ${{ vars.DOCKERHUB_USERNAME }}. The expressions should follow the established convention of including spaces for consistency.

Copilot uses AI. Check for mistakes.