From 4b92b70f893d4871bb9e5b9af95d649e7a4c9909 Mon Sep 17 00:00:00 2001 From: A Nomad Date: Mon, 9 Mar 2026 09:24:03 +0100 Subject: [PATCH 1/2] Add pipeline for deploy to new infra --- .github/workflows/deploy.yml | 57 +++++++++++++++++++++++++ .github/workflows/deploy_to_railway.yml | 10 ++--- 2 files changed, 62 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 00000000..40ff0c63 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,57 @@ +name: Deploy + +permissions: + id-token: write + contents: read + +on: + push: + branches: + - main + - 'release/pr-v*' + +jobs: + deploy: + runs-on: ubuntu-latest + environment: ${{ inputs.deploy-env || (github.ref_name == 'main' && 'Development') || (startsWith(github.ref_name, 'release/pr-v') && 'Production') || 'None' }} + + steps: + - uses: actions/checkout@v4 + + - uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ vars.PIPELINE_ROLE_ARN }} + aws-region: ${{ vars.AWS_REGION }} + + - uses: aws-actions/amazon-ecr-login@v2 + + - name: Build and push image + id: build + run: | + IMAGE_TAG=${{ github.sha }} + docker build -t ${{ vars.ECR_URL }}:$IMAGE_TAG . + docker push ${{ vars.ECR_URL }}:$IMAGE_TAG + echo "image=${{ vars.ECR_URL }}:$IMAGE_TAG" >> $GITHUB_OUTPUT + + - name: Get current task definition + run: | + aws ecs describe-task-definition \ + --task-definition ${{ vars.TASK_FAMILY }} \ + --query taskDefinition \ + > task-definition.json + + - name: Update image in task definition + id: render + uses: aws-actions/amazon-ecs-render-task-definition@v1 + with: + task-definition: task-definition.json + container-name: ${{ vars.CONTAINER_NAME }} + image: ${{ steps.build.outputs.image }} + + - name: Deploy to ECS + uses: aws-actions/amazon-ecs-deploy-task-definition@v2 + with: + task-definition: ${{ steps.render.outputs.task-definition }} + service: ${{ vars.ECS_SERVICE }} + cluster: ${{ vars.ECS_CLUSTER }} + wait-for-service-stability: true diff --git a/.github/workflows/deploy_to_railway.yml b/.github/workflows/deploy_to_railway.yml index d0d76b9e..6637a065 100644 --- a/.github/workflows/deploy_to_railway.yml +++ b/.github/workflows/deploy_to_railway.yml @@ -4,11 +4,11 @@ permissions: contents: read on: - push: - branches: - - main - - staging - - 'release/pr-v*' +# push: +# branches: +# # - main +# # - staging +# # - 'release/pr-v*' workflow_dispatch: inputs: From 5312772a6521024a2813c1d9090cd07ac5e7d38f Mon Sep 17 00:00:00 2001 From: A Nomad Date: Mon, 9 Mar 2026 09:30:33 +0100 Subject: [PATCH 2/2] remove input --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 40ff0c63..48a32655 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -13,7 +13,7 @@ on: jobs: deploy: runs-on: ubuntu-latest - environment: ${{ inputs.deploy-env || (github.ref_name == 'main' && 'Development') || (startsWith(github.ref_name, 'release/pr-v') && 'Production') || 'None' }} + environment: ${{ (github.ref_name == 'main' && 'Development') || (startsWith(github.ref_name, 'release/pr-v') && 'Production') || 'None' }} steps: - uses: actions/checkout@v4