Merge pull request #42 from cisagov/sspj/proof-of-concept

Add Django
This commit is contained in:
Seamus Johnston 2022-08-19 13:24:28 +00:00 committed by GitHub
commit 5e4c44a444
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 951 additions and 15 deletions

42
.github/workflows/deploy.yaml vendored Normal file
View file

@ -0,0 +1,42 @@
name: Build and deploy
# This workflow runs on pushes to main (typically,
# a merged pull request) and on pushes of tagged commits.
# Pushes to main will deploy to Unstable; tagged commits
# will deploy to Staging
on:
push:
branches:
- main
tags:
- v*
workflow_dispatch:
jobs:
deploy-unstable:
# if this job runs on a branch, we deduce that code
# has been pushed to main and should be deployed to unstable
if: ${{ github.ref_type == 'branch' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Deploy to cloud.gov sandbox
uses: 18f/cg-deploy-action@main
env:
DEPLOY_NOW: thanks
with:
cf_username: ${{ secrets.CF_USERNAME }}
cf_password: ${{ secrets.CF_PASSWORD }}
cf_org: sandbox-gsa
cf_space: dotgov-poc
push_arguments: "-f ops/manifests/manifest-unstable.yaml"
# deploy-staging:
# # if this job runs on a tag, we deduce that code
# # has been tagged for release and should be deployed to staging
# if: ${{ github.ref_type == 'tag' }}

34
.github/workflows/migrate.yaml vendored Normal file
View file

@ -0,0 +1,34 @@
name: Run Migrations
# This workflow can be run from the CLI
# gh workflow run migrate.yaml -f environment=sandbox
# OR
# cf run-task getgov-unstable --wait \
# --command 'python manage.py migrate' --name migrate
on:
workflow_dispatch:
inputs:
environment:
type: choice
description: Where should we run migrations
options:
- unstable
- staging
jobs:
migrate-unstable:
if: ${{ github.event.inputs.environment == 'unstable' }}
runs-on: ubuntu-latest
steps:
- name: Run Django migrations for unstable
uses: 18f/cg-deploy-action@main
with:
cf_username: ${{ secrets.CF_USERNAME }}
cf_password: ${{ secrets.CF_PASSWORD }}
cf_org: sandbox-gsa
cf_space: dotgov-poc
full_command: "cf run-task getgov-unstable --wait --command 'python manage.py migrate' --name migrate"
# migrate:
# if: ${{ github.event.inputs.environment == 'staging' }}