survey-extraction/.github/workflows/lambda_main.yml
2025-07-18 10:30:49 +00:00

91 lines
No EOL
2.7 KiB
YAML

name: Script to deploy lambdas to aws
on:
push:
branches: [feature/seperate_terraform_with_different_states, main]
env:
AWS_REGION: eu-west-2
jobs:
build-and-push-to-ecr-for-lambda-example:
runs-on: ubuntu-latest
env:
ECR_REPOSITORY: lambda_example
permissions:
id-token: write
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Run lambda shared action
uses: ./.github/workflows/actions/lambda
# - name: AWS credentials
# uses: aws-actions/configure-aws-credentials@v4
# with:
# # as of 14/07/2025 it'll be using user:Junte's keys
# aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
# aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# aws-region: ${{ secrets.AWS_REGION }}
# - name: Log in to Amazon ECR
# id: login-ecr
# uses: aws-actions/amazon-ecr-login@v2
# - name: Build, tag, and push Docker image to ECR
# env:
# ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
# IMAGE_TAG: latest
# run: |
# IMAGE_URI=${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }}
# echo "pwd"
# pwd
# ls -la
# echo "Building Docker image..."
# docker build -t $IMAGE_URI -f deployment/lambda/lambda_example/docker/Dockerfile .
# echo "Pushing Docker image to ECR..."
# docker push $IMAGE_URI
# build-and-push-to-ecr-for-extractor-and-loader-example:
# runs-on: ubuntu-latest
# env:
# ECR_REPOSITORY: extractor_and_loader
# permissions:
# id-token: write
# contents: read
# steps:
# - name: Checkout code
# uses: actions/checkout@v4
# - name: AWS credentials
# uses: aws-actions/configure-aws-credentials@v4
# with:
# # as of 14/07/2025 it'll be using user:Junte's keys
# aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
# aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# aws-region: ${{ secrets.AWS_REGION }}
# - name: Log in to Amazon ECR
# id: login-ecr
# uses: aws-actions/amazon-ecr-login@v2
# - name: Build, tag, and push Docker image to ECR
# env:
# ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
# IMAGE_TAG: latest
# run: |
# IMAGE_URI=${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }}
# echo "pwd"
# pwd
# ls -la
# echo "Building Docker image..."
# docker build -t $IMAGE_URI -f deployment/lambda/extractor_and_loader/docker/Dockerfile .
# echo "Pushing Docker image to ECR..."
# docker push $IMAGE_URI