From 0495f2c8772f57c4ab4f0e115e46e09881103037 Mon Sep 17 00:00:00 2001 From: Paul Craig Date: Mon, 18 Nov 2024 20:21:55 -0500 Subject: [PATCH] Delete the previous workflow files --- .github/workflows/old_django_ci.yml | 33 ---------- .github/workflows/old_django_gcp_deploy.yml | 59 ----------------- .github/workflows/old_django_gcp_migrate.yml | 67 -------------------- 3 files changed, 159 deletions(-) delete mode 100644 .github/workflows/old_django_ci.yml delete mode 100644 .github/workflows/old_django_gcp_deploy.yml delete mode 100644 .github/workflows/old_django_gcp_migrate.yml diff --git a/.github/workflows/old_django_ci.yml b/.github/workflows/old_django_ci.yml deleted file mode 100644 index 0963b483..00000000 --- a/.github/workflows/old_django_ci.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Django CI - -on: - push: - branches: - - main-1 - pull_request: - branches: - - main-1 - -jobs: - ci: - runs-on: ubuntu-latest - defaults: - run: - working-directory: ./bloom_nofos - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: "3.11.9" - - uses: Gr1N/setup-poetry@v8 - - uses: actions/cache@v4 - with: - path: ~/.cache/pypoetry/virtualenvs - key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }} - - run: poetry --version - - - name: Install dependencies - run: poetry install - - - name: Run tests - run: poetry run python manage.py test diff --git a/.github/workflows/old_django_gcp_deploy.yml b/.github/workflows/old_django_gcp_deploy.yml deleted file mode 100644 index 91f22eb4..00000000 --- a/.github/workflows/old_django_gcp_deploy.yml +++ /dev/null @@ -1,59 +0,0 @@ -# This workflow build and push a Docker container to Google Artifact Registry -# and deploy it on Cloud Run when a commit is pushed to the "main" -# branch. - -name: "Build and Deploy to Cloud Run" - -on: - push: - branches: - - main-1 - -env: - AR_REGION: "us" - PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }} - REPOSITORY: ${{ secrets.GCP_AR_REPO_NAME }} - SERVICE: ${{ secrets.GCP_SERVICE_NAME }} - SERVICE_REGION: "us-central1" - -jobs: - deploy: - runs-on: "ubuntu-latest" - - permissions: - contents: "read" - id-token: "write" - - steps: - - name: "Checkout" - uses: "actions/checkout@v4" - - # Configure auth with Service Account with permissions to build and deploy on Google Cloud - - id: "auth" - name: "Authenticate to Google Cloud" - uses: "google-github-actions/auth@v2" - with: - credentials_json: ${{ secrets.GCP_IAM_SA_CREDENTIALS }} - - # BEGIN - Docker auth and build - - name: "Docker Auth" - uses: "docker/login-action@v3" - with: - registry: "${{ env.AR_REGION }}-docker.pkg.dev" - username: _json_key - password: ${{ secrets.GCP_IAM_SA_CREDENTIALS }} - - - name: "Build and Push Container" - run: |- - DOCKER_TAG="${{ env.AR_REGION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.REPOSITORY }}/${{ env.SERVICE }}:${{ github.sha }}" - echo $DOCKER_TAG - docker build --tag "${DOCKER_TAG}" --build-arg IS_PROD_ARG=1 --build-arg GITHUB_SHA_ARG="${{ github.sha }}" . - docker push "${DOCKER_TAG}" - # END - Docker auth and build - - - name: "Deploy to Cloud Run" - uses: "google-github-actions/deploy-cloudrun@v2" - with: - service: "${{ env.SERVICE }}" - region: "${{ env.REGION }}" - image: "${{ env.AR_REGION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.REPOSITORY }}/${{ env.SERVICE }}:${{ github.sha }}" diff --git a/.github/workflows/old_django_gcp_migrate.yml b/.github/workflows/old_django_gcp_migrate.yml deleted file mode 100644 index e41a0a9f..00000000 --- a/.github/workflows/old_django_gcp_migrate.yml +++ /dev/null @@ -1,67 +0,0 @@ -name: "Migrate Django database in Cloud Run" - -on: - push: - branches: - - main-1 - - auto-migrate-and-auto-deploy-1 - -env: - AR_REGION: "us" - PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }} - REPOSITORY: ${{ secrets.GCP_AR_REPO_NAME }} - SERVICE: ${{ secrets.GCP_SERVICE_NAME }} - SERVICE_REGION: "us-central1" - -jobs: - migrate: - runs-on: "ubuntu-latest" - defaults: - run: - working-directory: ./bloom_nofos - - permissions: - contents: "read" - id-token: "write" - - steps: - - name: "Checkout" - uses: "actions/checkout@v4" - - - name: "Set up Python" - uses: actions/setup-python@v5 - with: - python-version: "3.11.9" - - - name: "Set up poetry" - uses: Gr1N/setup-poetry@v8 - - - uses: actions/cache@v4 - with: - path: ~/.cache/pypoetry/virtualenvs - key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }} - - - run: poetry --version - - # Configure auth with Service Account with permissions to build and deploy on Google Cloud - - id: "auth" - name: "Authenticate to Google Cloud" - uses: "google-github-actions/auth@v2" - with: - credentials_json: ${{ secrets.GCP_IAM_SA_CREDENTIALS }} - - # BEGIN - Django migration (if needed) - # sudo mv cloud-sql-proxy /usr/local/bin/ - - name: "Install Cloud SQL Auth Proxy" - run: | - curl -o cloud-sql-proxy https://storage.googleapis.com/cloud-sql-connectors/cloud-sql-proxy/v2.14.0/cloud-sql-proxy.linux.amd64 - chmod +x cloud-sql-proxy - ./cloud-sql-proxy ${{ secrets.GCP_CLOUD_CONNECTION_NAME }} & - - - name: Install poetry dependencies - run: poetry install - - - name: Run migration - env: - DATABASE_URL: ${{ secrets.DATABASE_URL }} - run: poetry run python manage.py migrate --plan