mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-01-07 22:33:57 -05:00
When deploying from the infra repo, migrations aren't run which can cause issues. We need to be able to manually dispatch deployment from this repo so that the migrations are run as well. ### Changes 🏗️ - add manual dispatch to deploy workflows ### Checklist 📋 #### For code changes: - [x] I have clearly listed my changes in the PR description - [x] I have made a test plan - [x] I have tested my changes according to the test plan: - [x] Either it works or it doesn't but this PR won't break anything existing
55 lines
1.4 KiB
YAML
55 lines
1.4 KiB
YAML
name: AutoGPT Platform - Deploy Prod Environment
|
|
|
|
on:
|
|
release:
|
|
types: [published]
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: 'read'
|
|
id-token: 'write'
|
|
|
|
jobs:
|
|
migrate:
|
|
environment: production
|
|
name: Run migrations for AutoGPT Platform
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{ github.ref_name || 'master' }}
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.11'
|
|
|
|
- name: Install Python dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install prisma
|
|
|
|
- name: Run Backend Migrations
|
|
working-directory: ./autogpt_platform/backend
|
|
run: |
|
|
python -m prisma migrate deploy
|
|
env:
|
|
DATABASE_URL: ${{ secrets.BACKEND_DATABASE_URL }}
|
|
DIRECT_URL: ${{ secrets.BACKEND_DATABASE_URL }}
|
|
|
|
|
|
trigger:
|
|
needs: migrate
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Trigger deploy workflow
|
|
uses: peter-evans/repository-dispatch@v3
|
|
with:
|
|
token: ${{ secrets.DEPLOY_TOKEN }}
|
|
repository: Significant-Gravitas/AutoGPT_cloud_infrastructure
|
|
event-type: build_deploy_prod
|
|
client-payload: |
|
|
{"ref": "${{ github.ref_name || 'master' }}", "repository": "${{ github.repository }}"}
|