Skip to content

Delete docker-file-image.yml #41

Delete docker-file-image.yml

Delete docker-file-image.yml #41

Workflow file for this run

name: 'Build Dockerfile'
on:
push:
branches: [ "main" ]
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 $ECR_REPO_URI/$ECR_REPO_NAME:latest
docker push $ECR_REPO_URI/$ECR_REPO_NAME:latest
env:
ECR_REPO_NAME : ${{ secrets.ECR_REPO_NAME }}
ECR_REPO_URI : ${{ secrets.ECR_REPO_URI }}