Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy ecs and apprunner in parallelism #404

Merged
merged 2 commits into from
Dec 13, 2024
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
37 changes: 35 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
cache-to: type=gha,mode=max
tags: ${{ steps.meta.outputs.tags }}

deploy:
deploy_migration:
runs-on: ubuntu-latest
concurrency:
group: "deploy"
Expand All @@ -47,7 +47,6 @@ jobs:
env:
AWS_REGION: us-west-2
steps:
- run: sudo apt-get update && sudo apt-get install jsonnet
- uses: actions/checkout@v4
- uses: aws-actions/configure-aws-credentials@v4
with:
Expand All @@ -58,7 +57,41 @@ jobs:
with:
version: latest
- run: ecspresso run --config deploy/ecspresso.jsonnet --ext-str IMAGE_SHA=${{ github.sha }} --overrides-file deploy/runtask-db-migrate.jsonnet
deploy_worker:
runs-on: ubuntu-latest
needs: ["deploy_migration"]
permissions:
id-token: write
contents: read
env:
AWS_REGION: us-west-2
steps:
- uses: actions/checkout@v4
- uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-west-2
role-skip-session-tagging: false
role-to-assume: "arn:aws:iam::861452569180:role/ConferenceAppDeployer"
- uses: kayac/ecspresso@v2
with:
version: latest
- run: ecspresso deploy --config deploy/ecspresso.jsonnet --ext-str IMAGE_SHA=${{ github.sha }}
deploy_app:
runs-on: ubuntu-latest
needs: ["deploy_migration"]
permissions:
id-token: write
contents: read
env:
AWS_REGION: us-west-2
steps:
- run: sudo apt-get update && sudo apt-get install jsonnet
- uses: actions/checkout@v4
- uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-west-2
role-skip-session-tagging: false
role-to-assume: "arn:aws:iam::861452569180:role/ConferenceAppDeployer"
- run: |
SERVICE_ARN=arn:aws:apprunner:us-west-2:861452569180:service/conference-app/37cc4e1e45894229965d668879123b40
until [ $(aws apprunner describe-service --service-arn ${SERVICE_ARN} --output json | jq -r '.Service.Status') = RUNNING ]
Expand Down
37 changes: 35 additions & 2 deletions .github/workflows/staging_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
cache-to: type=gha,mode=max
tags: ${{ steps.meta.outputs.tags }}

deploy:
deploy_migration:
runs-on: ubuntu-latest
concurrency:
group: "staging-deploy"
Expand All @@ -48,7 +48,6 @@ jobs:
env:
AWS_REGION: us-west-2
steps:
- run: sudo apt-get update && sudo apt-get install jsonnet
- uses: actions/checkout@v4
- uses: aws-actions/configure-aws-credentials@v4
with:
Expand All @@ -59,7 +58,41 @@ jobs:
with:
version: latest
- run: ecspresso run --config deploy/staging/ecspresso.jsonnet --ext-str IMAGE_SHA=${{ github.sha }} --overrides-file deploy/staging/runtask-db-migrate.jsonnet
deploy_worker:
runs-on: ubuntu-latest
needs: ["deploy_migration"]
permissions:
id-token: write
contents: read
env:
AWS_REGION: us-west-2
steps:
- uses: actions/checkout@v4
- uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-west-2
role-skip-session-tagging: false
role-to-assume: "arn:aws:iam::861452569180:role/ConferenceAppDeployer"
- uses: kayac/ecspresso@v2
with:
version: latest
- run: ecspresso deploy --config deploy/staging/ecspresso.jsonnet --ext-str IMAGE_SHA=${{ github.sha }}
deploy_app:
runs-on: ubuntu-latest
needs: ["deploy_migration"]
permissions:
id-token: write
contents: read
env:
AWS_REGION: us-west-2
steps:
- run: sudo apt-get update && sudo apt-get install jsonnet
- uses: actions/checkout@v4
- uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-west-2
role-skip-session-tagging: false
role-to-assume: "arn:aws:iam::861452569180:role/ConferenceAppDeployer"
- run: |
SERVICE_ARN=arn:aws:apprunner:us-west-2:861452569180:service/conference-app-staging/acfd5f3cb79044cf96a2d70c481da77a
until [ $(aws apprunner describe-service --service-arn ${SERVICE_ARN} --output json | jq -r '.Service.Status') = RUNNING ]
Expand Down
Loading