Skip to content

feat: add gateway mode support #10

feat: add gateway mode support

feat: add gateway mode support #10

Workflow file for this run

name: Deploy Compatibility Layer to Amazon ECS
on:
push:
branches:
- production
env:
AWS_REGION: us-east-2
jobs:
deployment:
name: Deploy Compatibility Layer
runs-on: ubuntu-latest
environment: production
env:
ECR_REPOSITORY: stateless/compatibility-layer
ECS_SERVICE: compatibility-layer
ECS_CLUSTER: StatelessCluster
ECS_TASK_DEFINITION: .aws/task-definition.json
CONTAINER_NAME: compatibility-layer
steps:
- name: Checkout
uses: actions/checkout@v4
- 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 }}
aws-region: ${{ env.AWS_REGION }}
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
- name: Build, tag, and push image to Amazon ECR
id: build-image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
IMAGE_TAG: ${{ github.sha }}
run: |
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: Fill in the new image ID in the Amazon ECS task definition
id: task-def
uses: aws-actions/amazon-ecs-render-task-definition@v1
with:
task-definition: ${{ env.ECS_TASK_DEFINITION }}
container-name: ${{ env.CONTAINER_NAME }}
image: ${{ steps.build-image.outputs.image }}
environment-variables: |
HTTP_PORT=${{ vars.HTTP_PORT }}
CONFIG_FILES=${{ vars.CONFIG_FILES }}
LOG_LEVEL=${{ vars.LOG_LEVEL }}
GATEWAY_MODE=${{ vars.GATEWAY_MODE }}
- name: Deploy Amazon ECS task definition
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
with:
task-definition: ${{ steps.task-def.outputs.task-definition }}
service: ${{ env.ECS_SERVICE }}
cluster: ${{ env.ECS_CLUSTER }}
wait-for-service-stability: true