Skip to content

generated file: .github/workflows/ci.yml #2

generated file: .github/workflows/ci.yml

generated file: .github/workflows/ci.yml #2

Workflow file for this run

name: Deploy to Production
on:
push:
branches:
- main
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install dependencies
run: pip install -r requirements.txt
- name: Build Docker image
run: docker build -t streamlined-digital-library-backend:latest .
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
- name: Push Docker image to Docker Hub
run: docker push streamlined-digital-library-backend:latest
- name: Deploy to Heroku
uses: akhileshns/heroku-deploy@v3
with:
heroku_app_name: streamlined-digital-library-production
heroku_api_key: ${{ secrets.HEROKU_API_KEY }}
docker_image: streamlined-digital-library-backend:latest
- name: Run database migrations
run: heroku run python src/infrastructure/database/migrations/alembic/upgrade head -a streamlined-digital-library-production