Merge pull request #123 from cisagov/ik/stable-uswds-assets

Add asset compilation and collection before deploy
This commit is contained in:
Igor Korenfeld 2022-09-15 12:03:47 -04:00 committed by GitHub
commit 784be2b279
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 1 deletions

View file

@ -24,6 +24,15 @@ jobs:
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- 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 - name: Deploy to cloud.gov sandbox
uses: 18f/cg-deploy-action@main uses: 18f/cg-deploy-action@main
env: env:

View file

@ -36,9 +36,15 @@ Binding the database in `manifest-<ENVIRONMENT>.json` automatically inserts the
# Deploy # Deploy
We have two environments: `unstable` and `staging`. Developers can deploy locally to unstable whenever they want. However, only our CD service can deploy to `staging`, and it does so on every commit to `main`. This is to ensure that we have a "golden" environment to point to, and can still test things out in an unstable space. To deploy locally to `unstable`: We have two environments: `unstable` and `staging`. Developers can deploy locally to unstable whenever they want. However, only our CD service can deploy to `staging`, and it does so on every commit to `main`. This is to ensure that we have a "golden" environment to point to, and can still test things out in an unstable space. You should make sure all of the USWDS assets are compiled and collected before deploying to unstable. To deploy locally to `unstable`:
```bash ```bash
# Compile and collect the assets
docker-compose run node npx gulp compile
docker-compose run node npx gulp copyAssets
docker-compose run app ./manage.py collectstatic
# Deploy to unstable
cf target -o cisa-getgov-prototyping -s unstable cf target -o cisa-getgov-prototyping -s unstable
cf push getgov-unstable -f ops/manifests/manifest-unstable.yaml cf push getgov-unstable -f ops/manifests/manifest-unstable.yaml
cf run-task getgov-unstable --command 'python manage.py migrate' --name migrate cf run-task getgov-unstable --command 'python manage.py migrate' --name migrate

View file

@ -28,6 +28,7 @@ uswds.paths.dist.img = ASSETS_DIR + 'img';
* Add as many as you need * Add as many as you need
*/ */
exports.default = uswds.compile;
exports.init = uswds.init; exports.init = uswds.init;
exports.compile = uswds.compile; exports.compile = uswds.compile;
exports.watch = uswds.watch; exports.watch = uswds.watch;