Skip to content

Merge pull request #49 from EveryVoiceTTS/dev/ilt #29

Merge pull request #49 from EveryVoiceTTS/dev/ilt

Merge pull request #49 from EveryVoiceTTS/dev/ilt #29

Workflow file for this run

name: "Prod: Build and push docker container"
on:
push:
branches:
- ilt
jobs:
build-push:
runs-on: ubuntu-latest
steps:
- name: Checkout repository with submodules
uses: actions/checkout@v4
with:
token: ${{ secrets.PAT }}
submodules: recursive
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ca-central-1
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
- name: Build, tag, and push docker image to Amazon ECR
id: push-image
env:
REGISTRY: ${{ steps.login-ecr.outputs.registry }}
REPOSITORY: common-voice
IMAGE_TAG: prod-${{ github.sha }}
run: |
echo "image_tag=$IMAGE_TAG" >> $GITHUB_OUTPUT
CURRENT_UID=$(id -u):$(id -g) docker-compose --project-name "common-voice" -f "docker-compose.yaml" build web
docker tag common-voice_web:latest $REGISTRY/$REPOSITORY:$IMAGE_TAG
docker push $REGISTRY/$REPOSITORY:$IMAGE_TAG
- name: Repository dispatch to trigger deployment
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.PAT }}
repository: ${{ vars.AWS_REPO }}
event-type: common-voice-deployment
client-payload: '{"tag": "${{ steps.push-image.outputs.image_tag }}"}'