From 1497c5819c772d936fada04ab7bb5f30934eda3a Mon Sep 17 00:00:00 2001 From: Vi Nguyen Date: Fri, 22 Dec 2023 13:11:27 +0700 Subject: [PATCH] infra: update build order --- .github/workflows/dev.yaml | 45 +++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/.github/workflows/dev.yaml b/.github/workflows/dev.yaml index dc75a0e..c09c367 100644 --- a/.github/workflows/dev.yaml +++ b/.github/workflows/dev.yaml @@ -1,8 +1,8 @@ name: Development on: - # push: - # branches: - # - main + push: + branches: + - main workflow_dispatch: concurrency: development env: @@ -15,7 +15,26 @@ env: BUILD_SOURCE_VERSION: ${{ github.sha }} jobs: + build_asset: + name: Build Asset + runs-on: ubuntu-latest + environment: Development + permissions: + id-token: write + contents: read + steps: + - uses: actions/checkout@v3 + - uses: aws-actions/configure-aws-credentials@v2 + with: + aws-region: ${{ vars.AWS_REGION }} + role-to-assume: ${{ vars.AWS_ROLE }} + - name: Build, tag, and push image to Amazon ECR + working-directory: . + run: | + yarn + yarn nx run-many -t build --all iam_deploy: + needs: build_asset name: Deploy IAM Task execution Role Development runs-on: ubuntu-latest environment: Development @@ -45,26 +64,8 @@ jobs: working-directory: infra run: | yarn cdk:deploy:iam-stack - build_asset: - name: Build Asset - runs-on: ubuntu-latest - environment: Development - permissions: - id-token: write - contents: read - steps: - - uses: actions/checkout@v3 - - uses: aws-actions/configure-aws-credentials@v2 - with: - aws-region: ${{ vars.AWS_REGION }} - role-to-assume: ${{ vars.AWS_ROLE }} - - name: Build, tag, and push image to Amazon ECR - working-directory: . - run: | - yarn - yarn nx run-many -t build --all lambda_deploy: - needs: [build_asset, iam_deploy] + needs: [iam_deploy] name: Deploy Lambda runs-on: ubuntu-latest environment: Development