Skip to content

Update lambda_handler.py #27

Update lambda_handler.py

Update lambda_handler.py #27

Workflow file for this run

name: 'Build Dockerfile'
on:
push:
branches: [ "aws-cloud" ]
permissions:
contents: read
id-token: write
jobs:
playlist_gen:
name: 'Playlist Generator'
runs-on: ubuntu-latest
environment: production
# Use the Bash shell regardless whether the GitHub Actions runner is ubuntu-latest, macos-latest, or windows-latest
defaults:
run:
shell: bash
steps:
# Checkout the repository to the GitHub Actions runner
- name: Checkout
uses: actions/checkout@v3
- name: Authenticate with AWS using OIDC
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ secrets.AWS_WEB_IDENTITY_ROLE_ARN }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Deploy to ECR
run: |
aws ecr get-login-password --region eu-west-2 | docker login --username AWS --password-stdin $ECR_REPO_URI
docker build -t playlist_gen_repo . --platform=linux/amd64
docker tag playlist_gen_repo:latest 547882234658.dkr.ecr.eu-west-2.amazonaws.com/playlist_gen_repo:latest
docker push 547882234658.dkr.ecr.eu-west-2.amazonaws.com/playlist_gen_repo:latest
env:
ECR_REPO_NAME : ${{ secrets.ECR_REPO_NAME }}
ECR_REPO_URI : ${{ secrets.ECR_REPO_URI }}