Skip to content

Commit

Permalink
Fix GH Workflow file
Browse files Browse the repository at this point in the history
  • Loading branch information
eternaltyro committed Jun 6, 2024
1 parent cfb2ee2 commit 35c4b1f
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions .github/workflows/ecs-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ env:
IMAGE_NAME: hotosm/raw-data-api # was ${{ github.repository }}

jobs:
build-push-image:
name: Build Images
image-build-and-push:
name: Build Container Images
runs-on: ubuntu-latest
environment: production

Expand All @@ -26,14 +26,11 @@ jobs:
packages: write

outputs:
imageid: steps.build-push-image.imageid
imageid: ${{ steps.meta.outputs.tags }}

steps:
- name: Setup QEMU
uses: docker/setup-qemu-action@v3

- name: Setup Buildx
uses: docker/setup-buildx-action@v3
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3

- name: Log in to the Container registry
uses: docker/login-action@v3
Expand All @@ -47,7 +44,6 @@ jobs:
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

tags: |
type=ref,event=branch
Expand All @@ -56,12 +52,14 @@ jobs:
uses: docker/build-push-action@v5
with:
context: "{{defaultContext}}"
target: prod
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

deploy:
name: Deploy
name: Deploy to ECS
runs-on: ubuntu-latest
environment: production

Expand All @@ -72,15 +70,14 @@ jobs:
id-token: write

steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-east-1
role-to-assume: arn:aws:iam::670261699094:role/Github-AWS-OIDC
role-session-name: gh-ci-ecs-deploy
role-session-name: ghci-ecs-deploy-rawdat

- name: Download task definition
run: |
Expand All @@ -92,7 +89,7 @@ jobs:
with:
task-definition: task-definition.json
container-name: ${{ env.CONTAINER_NAME }}
image: ${{ needs.build-push-image.outputs.imageid }}
image: ${{ needs.image-build-and-push.outputs.image_tags }}

- name: Deploy task definition
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
Expand All @@ -101,3 +98,4 @@ jobs:
service: ${{ env.ECS_SERVICE }}
cluster: ${{ env.ECS_CLUSTER }}
wait-for-service-stability: true

0 comments on commit 35c4b1f

Please sign in to comment.