Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reverting deploy-api.yml to its previous state #102

Merged
merged 1 commit into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 6 additions & 22 deletions .github/workflows/deploy-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ name: Deploy to Cloud Run
on:
push:
branches:
- main # Update the branch as needed
- main # Update the branch as needed
# pull_request:
# branches:
# - main

jobs:
deploy:
Expand All @@ -13,19 +16,7 @@ jobs:
# Checkout the code
- name: Checkout code
uses: actions/checkout@v3

# Set up Python environment (for Alembic)
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10" # Specify the Python version

# Install dependencies
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt # Ensure Alembic is in your requirements


# Set up Google Cloud authentication
- name: Authenticate to Google Cloud
uses: google-github-actions/[email protected]
Expand All @@ -40,13 +31,6 @@ jobs:
service_account_key: ${{ secrets.GCP_SA_KEY }}
export_default_credentials: true

# Run Alembic migrations
- name: Run Alembic migrations
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }} # Ensure this is set in your repo secrets
run: |
alembic upgrade head # Runs the migration to the latest version

# Authenticate Docker with GCP
- name: Authenticate Docker
run: |
Expand All @@ -65,5 +49,5 @@ jobs:
export APP=${{ secrets.APP_NAME }}
export TAG=gcr.io/${{ secrets.GCP_PROJECT_ID }}/${APP}
export REGION=${{ secrets.GCP_REGION }}

gcloud run deploy $APP --image $TAG --platform managed --region $REGION --allow-unauthenticated
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('users', sa.Column('oauth_type', sa.String(), nullable=False))
# ### end Alembic commands ###
op.execute("UPDATE users SET oauth_type = Credentials")


def downgrade() -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,14 @@
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('users', 'oauth_type',
existing_type=sa.VARCHAR(),
nullable=True)
existing_type=sa.VARCHAR(),
nullable=True)
# ### end Alembic commands ###
op.execute("UPDATE users SET oauth_type = Credentials")


def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('users', 'oauth_type',
existing_type=sa.VARCHAR(),
nullable=False)
existing_type=sa.VARCHAR(),
nullable=False)
# ### end Alembic commands ###
Loading