From 9bf16c70a1cfd4e288220b110b404a5a0d1a2603 Mon Sep 17 00:00:00 2001 From: Nathan Souza Date: Tue, 8 Oct 2024 11:23:54 -0300 Subject: [PATCH] fix: ajusta pipeline --- .github/workflows/pipeline_deploy_lambda.yaml | 47 ++++++++++--------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/.github/workflows/pipeline_deploy_lambda.yaml b/.github/workflows/pipeline_deploy_lambda.yaml index fb9e4f4..63bd006 100644 --- a/.github/workflows/pipeline_deploy_lambda.yaml +++ b/.github/workflows/pipeline_deploy_lambda.yaml @@ -15,25 +15,28 @@ jobs: runs-on: ubuntu-latest steps: - - name: Check out code - uses: actions/checkout@v4 - - - name: Set up Terraform - uses: hashicorp/setup-terraform@v3 - - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - role-to-assume: "arn:aws:iam::340752815603:role/oidc-github-framework-eml-role" - role-session-name: GitHub_to_AWS_via_FederatedOIDC - aws-region: "us-east-1" - - - name: Login to Amazon ECR - id: login-ecr - uses: aws-actions/amazon-ecr-login@v2 - - - name: Run Terraform init - run: | - cd deployment/lambda/terraform-lambda - terraform init - terraform plan + - name: Check out code + uses: actions/checkout@v4 + with: + ref: ${{ github.ref }} + + - name: Set up Terraform + uses: hashicorp/setup-terraform@v3 + with: + terraform_version: 1.8.0 + + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: "arn:aws:iam::340752815603:role/oidc-github-framework-eml-role" + role-session-name: GitHub_to_AWS_via_FederatedOIDC + aws-region: ${{ env.AWS_REGION }} + + - name: Create ECR + run: | + chmod +x deployment/scripts/create_ecr.sh + ./deployment/scripts/create_ecr.sh ${{ env.REPO_NAME }} ${{ env.AWS_REGION }} + +env: + REPO_NAME: "prediction-eml" + AWS_REGION: "us-east-1"