Spaces:
Runtime error
Runtime error
| name: Deploy to Heroku | |
| on: | |
| push: | |
| branches: | |
| - main # Trigger deployment when code is pushed to the main branch | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # Check out the repository | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| # Log in to Heroku Container Registry | |
| - name: Log in to Heroku Container Registry | |
| env: | |
| HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }} | |
| run: | | |
| echo "$HEROKU_API_KEY" | docker login --username=_ --password-stdin registry.heroku.com | |
| # Build the Docker image | |
| - name: Build Docker image | |
| run: | | |
| docker buildx build --provenance false --platform linux/amd64 -t registry.heroku.com/novel-chatbot/web . | |
| # Push the Docker image to Heroku | |
| - name: Push Docker image to Heroku | |
| run: | | |
| docker push registry.heroku.com/novel-chatbot/web:latest | |
| # Release the image to Heroku | |
| - name: Release Docker image to Heroku | |
| env: | |
| HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }} | |
| run: | | |
| heroku container:release web --app novel-chatbot |