diff --git a/.github/workflows/lambda_workflows/main.yml b/.github/workflows/lambda_workflows/main.yml new file mode 100644 index 0000000..4d2a9ec --- /dev/null +++ b/.github/workflows/lambda_workflows/main.yml @@ -0,0 +1,89 @@ +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: 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 \ No newline at end of file diff --git a/.github/workflows/push_docker_image_to_ecr.yml b/.github/workflows/push_docker_image_to_ecr.yml deleted file mode 100644 index d96507f..0000000 --- a/.github/workflows/push_docker_image_to_ecr.yml +++ /dev/null @@ -1,89 +0,0 @@ -name: Build and Push Docker Image to ECR lambda example - -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: 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 \ No newline at end of file