Create dev sandboxes scripts and first sandbox (#370)

* Add templates, scripts, and process documentation for creating and destroying developer sandboxes

* Create developer sandbox 'lmm' infrastructure

* fix up newlines

* fix action syntax pull_request

* add a line about the public.crt to developer docs

* add docs about branch conventions

* add new developer sandbox 'ik' infrastructure

* Add new developer sandbox 'nmb' infrastructure

* Add new developer sandbox 'sspj' infrastructure

* Add new developer sandbox 'mr' infrastructure

* make github actions dynamic by environment

* trying something out with dynamic github action for dev sandbox

* consolidate github actions to dynamic action

* try out run name

* combo run name and name

* respond to comments
This commit is contained in:
Logan McDonald 2023-01-20 09:50:36 -08:00 committed by GitHub
parent 6a54bf1ff4
commit 508e5384cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 524 additions and 67 deletions

51
.github/workflows/deploy-sandbox.yaml vendored Normal file
View file

@ -0,0 +1,51 @@
# This workflow runs on pushes when a pull request is opened under certain branch conventions.
name: Build and deploy developer sandbox
run-name: Build and deploy developer sandbox for branch ${{ github.ref_name }}
on:
pull_request:
paths-ignore:
- 'docs/**'
branches:
- 'ik/**'
- 'sspj/**'
- 'lmm/**'
- 'nmb/**'
- 'mr/**'
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Split branch name
env:
BRANCH: ${{ github.ref_name }}
id: split
run: echo "::set-output name=fragment::${BRANCH##*/}"
- name: Set secrets
id: secret
run: |
echo "::set-output name=cf_username::CF_${{ steps.split.outputs.fragment }}_USERNAME"
echo "::set-output name=cf_password::CF_${{ steps.split.outputs.fragment }}_PASSWORD"
- name: Compile USWDS assets
working-directory: ./src
run: |
docker compose run node npm install &&
docker compose run node npx gulp copyAssets &&
docker compose run node npx gulp compile
- name: Collect static assets
working-directory: ./src
run: docker compose run app python manage.py collectstatic
- name: Deploy to cloud.gov sandbox
uses: 18f/cg-deploy-action@main
env:
DEPLOY_NOW: thanks
with:
cf_username: ${{ secrets[steps.secret.outputs.cf_username] }}
cf_password: ${{ secrets[steps.secret.outputs.cf_password] }}
cf_org: cisa-getgov-prototyping
cf_space: ${{ steps.split.outputs.fragment }}
push_arguments: "-f ops/manifests/manifest-${{ steps.split.outputs.fragment }}.yaml"