Skip to content

Commit

Permalink
Chore: Update actions to v2 and assumed role
Browse files Browse the repository at this point in the history
  • Loading branch information
krisrjohnson21 authored Oct 16, 2023
1 parent 8622f50 commit e2ead7f
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 23 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/deploy-dev-blue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
environment: dev-blue
concurrency: dev-blue
if: github.repository_owner == 'mbta'
Expand All @@ -18,16 +21,14 @@ jobs:

steps:
- uses: actions/checkout@v2
- uses: mbta/actions/build-push-ecr@v1
- uses: mbta/actions/build-push-ecr@v2
id: build-push
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
docker-repo: ${{ secrets.DOCKER_REPO }}
- uses: mbta/actions/deploy-ecs@v1
- uses: mbta/actions/deploy-ecs@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
ecs-cluster: ${{ env.ECS_CLUSTER }}
ecs-service: ${{ env.ECS_SERVICE }}
docker-tag: ${{ steps.build-push.outputs.docker-tag }}
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/deploy-dev-green.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
environment: dev-green
concurrency: dev-green
env:
Expand All @@ -14,16 +17,14 @@ jobs:

steps:
- uses: actions/checkout@v2
- uses: mbta/actions/build-push-ecr@v1
- uses: mbta/actions/build-push-ecr@v2
id: build-push
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
docker-repo: ${{ secrets.DOCKER_REPO }}
- uses: mbta/actions/deploy-ecs@v1
- uses: mbta/actions/deploy-ecs@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
ecs-cluster: ${{ env.ECS_CLUSTER }}
ecs-service: ${{ env.ECS_SERVICE }}
docker-tag: ${{ steps.build-push.outputs.docker-tag }}
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/deploy-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
environment: dev
concurrency: dev
env:
Expand All @@ -17,16 +20,14 @@ jobs:

steps:
- uses: actions/checkout@v2
- uses: mbta/actions/build-push-ecr@v1
- uses: mbta/actions/build-push-ecr@v2
id: build-push
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
docker-repo: ${{ secrets.DOCKER_REPO }}
- uses: mbta/actions/deploy-ecs@v1
- uses: mbta/actions/deploy-ecs@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
ecs-cluster: ${{ env.ECS_CLUSTER }}
ecs-service: ${{ env.ECS_SERVICE }}
docker-tag: ${{ steps.build-push.outputs.docker-tag }}
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/deploy-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
environment: prod
concurrency: prod
env:
Expand All @@ -14,17 +17,16 @@ jobs:

steps:
- uses: actions/checkout@v2
- uses: mbta/actions/build-push-ecr@v1
- uses: mbta/actions/build-push-ecr@v2
id: build-push
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
docker-repo: ${{ secrets.DOCKER_REPO }}
- name: Deploy to ECS
uses: mbta/actions/deploy-ecs@v1
uses: mbta/actions/deploy-ecs@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
ecs-cluster: ${{ env.ECS_CLUSTER }}
ecs-service: ${{ env.ECS_SERVICE }}
docker-tag: ${{ steps.build-push.outputs.docker-tag }}
Expand Down

0 comments on commit e2ead7f

Please sign in to comment.