diff --git a/.github/workflows/actions/lambda/action.yml b/.github/workflows/actions/lambda/action.yml index b3364de..0105000 100644 --- a/.github/workflows/actions/lambda/action.yml +++ b/.github/workflows/actions/lambda/action.yml @@ -8,6 +8,9 @@ inputs: dockerfile_path: description: "Path to Dockerfile" required: true + ecr_tf_dir: + description: "Path to ECR terrform directory" + required: true aws_region: description: "AWS region" required: false @@ -29,6 +32,11 @@ runs: id: login-ecr uses: aws-actions/amazon-ecr-login@v2 + - name: Deploy ECR + uses: ./.github/actions/terraform-deploy + with: + working_directory: ${{ inputs.ecr_tf_dir }} + - name: Build and push Docker image shell: bash run: | diff --git a/.github/workflows/lambda_main.yml b/.github/workflows/lambda_main.yml index 02fa1c6..211f8d5 100644 --- a/.github/workflows/lambda_main.yml +++ b/.github/workflows/lambda_main.yml @@ -8,8 +8,17 @@ env: AWS_REGION: eu-west-2 jobs: + shared-lambda-terraform: + runs-on: ubuntu-latest + steps: + - name: Deploy shared Lambda Config Terraform + uses: ./.github/actions/terraform-deploy + with: + working_directory: deployment/lambda_shared + lambda-ecr-example: runs-on: ubuntu-latest + needs: shared-lambda-terraform permissions: id-token: write contents: read @@ -20,9 +29,11 @@ jobs: with: lambda_name: lambda_example dockerfile_path: deployment/lambda/lambda_example/docker/Dockerfile + ecr_tf_dir: deployment/lambda/lambda_example/docker/ extractor-and-loader: runs-on: ubuntu-latest + needs: shared-lambda-terraform permissions: id-token: write contents: read @@ -33,3 +44,4 @@ jobs: with: lambda_name: extractor_and_loader dockerfile_path: deployment/lambda/extractor_and_loader/docker/Dockerfile + ecr_tf_dir: deployment/lambda/extractor_and_loader/docker/