Skip to content
Merged
Show file tree
Hide file tree
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
13 changes: 3 additions & 10 deletions .github/actions/api-deploy-ecs/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@ name: API Deploy to ECS
description: Deploy the Flagsmith API to ECS

inputs:
aws_access_key_id:
description: The AWS access key ID to use for deploying to ECS.
required: true
aws_secret_access_key:
description: The AWS secret access key to use for deploying to ECS.
aws_role_arn:
description: The ARN of the AWS role to use for deploying to ECS
required: true
# TODO: do we need cluster name and ARN
aws_ecs_cluster_name:
Expand Down Expand Up @@ -55,8 +52,7 @@ runs:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ inputs.aws_access_key_id }}
aws-secret-access-key: ${{ inputs.aws_secret_access_key }}
role-to-assume: ${{ inputs.aws_role_arn }}
aws-region: eu-west-2

- name: Render SDK API task definition
Expand Down Expand Up @@ -87,9 +83,6 @@ runs:
- name: Register and perform SQL schema migration
id: register-migrate-task
env:
AWS_ACCESS_KEY_ID: ${{ inputs.aws_access_key_id }}
AWS_SECRET_ACCESS_KEY: ${{ inputs.aws_secret_access_key }}
AWS_DEFAULT_REGION: eu-west-2
TASK_DEFINITION: ${{ steps.task-def-migration.outputs.task-definition }}
run: |
echo "task_definition_arn=$(aws ecs register-task-definition --cli-input-json file://$TASK_DEFINITION | jq '.taskDefinition.taskDefinitionArn')" >> $GITHUB_OUTPUT
Expand Down
10 changes: 3 additions & 7 deletions .github/actions/task-processor-deploy-ecs/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@ name: Task Processor Deploy to ECS
description: Deploy the Flagsmith Task Processor to ECS

inputs:
aws_access_key_id:
description: The AWS access key ID to use for deploying to ECS.
required: true
aws_secret_access_key:
description: The AWS secret access key to use for deploying to ECS.
aws_role_arn:
description: The ARN of the AWS role to use for deploying to ECS
required: true
aws_ecs_cluster_name:
description: The name of the ECS cluster to deploy to.
Expand All @@ -28,8 +25,7 @@ runs:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ inputs.aws_access_key_id }}
aws-secret-access-key: ${{ inputs.aws_secret_access_key }}
role-to-assume: ${{ inputs.aws_role_arn }}
aws-region: eu-west-2

- name: Fill in the new image ID in the Amazon ECS Task Processor task definition
Expand Down
15 changes: 6 additions & 9 deletions .github/workflows/.reusable-deploy-ecs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,8 @@ jobs:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ vars.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
role-to-assume: ${{ vars.AWS_ROLE_ARN }}
aws-region: eu-west-2
mask-aws-account-id: 'no'

- name: Login to Amazon ECR
id: login-ecr
Expand Down Expand Up @@ -76,6 +74,9 @@ jobs:
needs: docker-build-saas-api
environment: ${{ inputs.environment }}
runs-on: depot-ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Cloning repo
uses: actions/checkout@v5
Expand All @@ -84,8 +85,7 @@ jobs:
id: deploy-api
uses: ./.github/actions/api-deploy-ecs
with:
aws_access_key_id: ${{ vars.AWS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws_role_arn: ${{ vars.AWS_ROLE_ARN }}
aws_ecs_cluster_name: ${{ vars.AWS_ECS_CLUSTER_NAME }}
aws_ecs_cluster_arn: ${{ vars.AWS_ECS_CLUSTER_ARN }}
aws_ecs_service_name: ${{ vars.AWS_ECS_SERVICE_NAME }}
Expand All @@ -101,8 +101,7 @@ jobs:
- name: Deploy Task processor to ${{ inputs.environment }}
uses: ./.github/actions/task-processor-deploy-ecs
with:
aws_access_key_id: ${{ vars.AWS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws_role_arn: ${{ vars.AWS_ROLE_ARN }}
aws_ecs_cluster_name: ${{ vars.AWS_ECS_CLUSTER_NAME }}
aws_ecs_service_name: ${{ vars.AWS_ECS_TASK_PROCESSOR_SERVICE_NAME }}
aws_task_definitions_directory_path: infrastructure/aws/${{ inputs.environment }}
Expand All @@ -127,13 +126,11 @@ jobs:
run: |
sudo apt-get remove -y firefox || true
sudo rm -rf /usr/bin/firefox /usr/lib/firefox*

ARCH=$(uname -m)
wget -O /tmp/firefox.tar.xz "https://ftp.mozilla.org/pub/firefox/releases/143.0/linux-${ARCH}/en-US/firefox-143.0.tar.xz"
sudo tar -xJf /tmp/firefox.tar.xz -C /opt
sudo ln -s /opt/firefox/firefox /usr/local/bin/firefox
rm /tmp/firefox.tar.xz

firefox --version

- name: Run E2E tests against ${{ inputs.environment }}
Expand Down
Loading