Merge pull request #288 from agentcoinorg/patch-certifi #21
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CD Prod Agent | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
deploy: | |
permissions: | |
contents: 'read' | |
id-token: 'write' | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: . | |
steps: | |
- uses: 'actions/checkout@v4' | |
- uses: supabase/setup-cli@v1 | |
with: | |
version: latest | |
- run: supabase link --project-ref $PROJECT_ID --password $DB_PASSWORD --debug | |
env: | |
DB_PASSWORD: ${{ secrets.PROD_SUPABASE_DB_PASSWORD }} | |
PROJECT_ID: ${{ secrets.PROD_SUPABASE_PROJECT_ID }} | |
SUPABASE_ACCESS_TOKEN: ${{ secrets.PROD_SUPABASE_ACCESS_TOKEN }} | |
- run: supabase db push --password $DB_PASSWORD --include-all | |
env: | |
DB_PASSWORD: ${{ secrets.PROD_SUPABASE_DB_PASSWORD }} | |
SUPABASE_ACCESS_TOKEN: ${{ secrets.PROD_SUPABASE_ACCESS_TOKEN }} | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.10" | |
- name: Install and configure Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
version: 1.7.1 | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
- name: Install dependencies | |
run: poetry install | |
- name: Check types | |
run: poetry run build-check | |
- id: 'auth' | |
uses: 'google-github-actions/auth@v2' | |
with: | |
workload_identity_provider: ${{ secrets.GOOGLE_WIP }} | |
service_account: ${{ secrets.GOOGLE_SA }} | |
- name: 'Set up Cloud SDK' | |
uses: 'google-github-actions/setup-gcloud@v1' | |
with: | |
version: '>= 363.0.0' | |
- name: 'Use gcloud CLI' | |
run: 'gcloud info' | |
- name: Create .deploy.env file | |
run: | | |
echo "ALCHEMY_API_KEY=${{ secrets.ALCHEMY_API_KEY }}" >> .deploy.env | |
echo "OPENAI_API_KEY=${{ secrets.CI_OPENAI_API_KEY }}" >> .deploy.env | |
echo "OPENAI_BASE_URL=https://api.openai.com/v1" >> .deploy.env | |
echo "OPENAI_MODEL_NAME=gpt-4o" >> .deploy.env | |
echo "COINGECKO_API_KEY=${{ secrets.CI_COINGECKO_API_KEY }}" >> .deploy.env | |
echo "LIFI_API_KEY=${{ secrets.LIFI_API_KEY }}" >> .deploy.env | |
echo "SUPABASE_SERVICE_ROLE_KEY=${{ secrets.PROD_SUPABASE_SERVICE_ROLE_KEY }}" >> .deploy.env | |
echo "SUPABASE_URL=${{ secrets.PROD_SUPABASE_URL }}" >> .deploy.env | |
- name: Export requirements.txt from Poetry | |
run: poetry export --without-hashes --format=requirements.txt > requirements.txt | |
- name: 'Deploy to Cloud Run' | |
run: | | |
gcloud run deploy autotx-prod \ | |
--port 8080 \ | |
--source . \ | |
--region=us-east1 \ | |
--allow-unauthenticated |