name: Deploy to Heroku on: push: branches: - main jobs: 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 # Match your app's Python version - name: Install Dependencies run: | python -m pip install --upgrade pip pip install -r requirements.txt - name: Test Application run: | pytest # Assuming you have tests configured - name: Deploy to Heroku env: HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }} HEROKU_APP_NAME: ${{ secrets.HEROKU_APP_NAME }} run: | echo "Deploying to Heroku..." heroku container:login heroku container:push web --app $HEROKU_APP_NAME heroku container:release web --app $HEROKU_APP_NAME