diff --git a/.github/workflows/push-demo.yml b/.github/workflows/push-demo.yml deleted file mode 100644 index 6f513fd..0000000 --- a/.github/workflows/push-demo.yml +++ /dev/null @@ -1,88 +0,0 @@ -name: Deploy Demo - -on: - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - inputs: - branch_name: - description: branch to deploy - required: true - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - ref: ${{ inputs.branch_name }} - - - uses: actions/cache@v2 - id: api-npm-cache - with: - path: ./api/node_modules/ - key: ${{ runner.os }}-api-npm-${{ hashFiles('./api/package-lock.json') }} - - - uses: actions/cache@v2 - id: frontend-npm-cache - with: - path: ./frontend/node_modules/ - key: ${{ runner.os }}-frontend-npm-${{ hashFiles('./frontend/package-lock.json') }} - - - uses: actions/cache@v2 - id: frontend-scss-cache - with: - path: ./frontend/src/styles/ - key: ${{ runner.os }}-frontend-scss-${{ hashFiles('./frontend/src/scss/**.scss') }} - - # Notice that the cache for the frontend is actually in the api directory... - - uses: actions/cache@v2 - id: frontend-src-cache - with: - path: ./api/src/client - key: ${{ runner.os }}-frontend-src-${{ hashFiles('./frontend/src/**/*', './frontend/package.json') }} - - # Build frontend - - uses: actions/setup-node@v2 - with: - node-version: "12" - - - name: Install frontend dependencies - if: steps.frontend-npm-cache.outputs.cache-hit != 'true' - run: npm ci - working-directory: frontend - - - name: Build frontend styles - if: steps.frontend-scss-cache.outputs.cache-hit != 'true' - run: npm run build:styles - working-directory: frontend - - - name: Build frontend - if: steps.frontend-src-cache.outputs.cache-hit != 'true' - run: npm run build:stage - working-directory: frontend - - # Build backend - - uses: actions/setup-node@v2 - with: - node-version: "14" - - - name: Install dependencies - if: steps.api-npm-cache.outputs.cache-hit != 'true' - run: npm ci - working-directory: api - - # Because of how the deploy works, do not cache backend - # frontend changes _will not_ make it if that's the case - - name: Build backend - run: npm run build - working-directory: api - - - name: Deploy to cloud.gov - uses: cloud-gov/cg-cli-tools@main - with: - cf_api: https://api.fr.cloud.gov - cf_username: ${{secrets.STAGE_CF_USERNAME}} - cf_password: ${{secrets.STAGE_CF_PASSWORD}} - cf_org: gsa-open-opportunities - cf_space: USDS - cf_manifest: deployDemo.yml diff --git a/.github/workflows/push-dev.yml b/.github/workflows/push-dev.yml deleted file mode 100644 index 537d94e..0000000 --- a/.github/workflows/push-dev.yml +++ /dev/null @@ -1,118 +0,0 @@ -# This is a basic workflow to help you get started with Actions - -name: Deploy Dev - -# Controls when the workflow will run -on: - push: - branches: [stage] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - - # workflow_call: - # secrets: - # STAGE_CF_USERNAME: - # description: cf-login username - # required: true - # STAGE_CF_PASSWORD: - # description: cf-login password - # required: true - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - # This workflow contains a single job called "build" - build: - # The type of runner that the job will run on - runs-on: ubuntu-latest - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - - uses: actions/checkout@v2 - with: - ref: ${{ inputs.branch_name }} - # - uses: actions/cache@v2 - # with: - # path: ~/.npm - # key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - # restore-keys: | - # ${{ runner.os }}-node- - - - uses: actions/cache@v2 - id: api-npm-cache - with: - path: ./api/node_modules/ - key: ${{ runner.os }}-api-npm-${{ hashFiles('./api/package-lock.json') }} - - - uses: actions/cache@v2 - id: frontend-npm-cache - with: - path: ./frontend/node_modules/ - key: ${{ runner.os }}-frontend-npm-${{ hashFiles('./frontend/package-lock.json') }} - - - uses: actions/cache@v2 - id: frontend-scss-cache - with: - path: ./frontend/src/styles/ - key: ${{ runner.os }}-frontend-scss-${{ hashFiles('./frontend/src/scss/**.scss') }} - - # Notice that the cache for the frontend is actually in the api directory... - - uses: actions/cache@v2 - id: frontend-src-cache - with: - path: ./api/src/client - key: ${{ runner.os }}-frontend-src-${{ hashFiles('./frontend/src/**/*', './frontend/package.json') }} - - # Build frontend (requires node 12) - - uses: actions/setup-node@v2 - with: - node-version: "12" - - - name: Install frontend dependencies - if: steps.frontend-npm-cache.outputs.cache-hit != 'true' - run: npm ci - working-directory: frontend - - - name: Build frontend styles - if: steps.frontend-scss-cache.outputs.cache-hit != 'true' - run: npm run build:styles - working-directory: frontend - - - name: Build frontend - if: steps.frontend-src-cache.outputs.cache-hit != 'true' - run: npm run build:stage - working-directory: frontend - - # Build backend (requires node 14) - - uses: actions/setup-node@v2 - with: - node-version: "14" - - - name: Install dependencies - if: steps.api-npm-cache.outputs.cache-hit != 'true' - run: npm ci - working-directory: api - - # Because of how the deploy works, do not cache backend - # frontend changes _will not_ make it if that's the case - - name: Build backend - run: npm run build - working-directory: api - - # - name: Update Login.gov creds on cloud.gov - # uses: cloud-gov/cg-cli-tools@main - # with: - # cf_api: https://api.fr.cloud.gov - # cf_username: ${{secrets.STAGE_CF_USERNAME}} - # cf_password: ${{secrets.STAGE_CF_PASSWORD}} - # cf_org: gsa-open-opportunities - # cf_space: USDS - # cf_command: cf set-env smeqa-staging LOGIN_KEY "${{secrets.STAGE_LOGIN_KEY_11_22_21}}" - - name: Deploy to cloud.gov - uses: cloud-gov/cg-cli-tools@main - with: - cf_api: https://api.fr.cloud.gov - cf_username: ${{secrets.DEV_CF_USERNAME}} - cf_password: ${{secrets.DEV_CF_PASSWORD}} - cf_org: gsa-tts-usdc - cf_space: dev - cf_manifest: deployDev.yml diff --git a/.github/workflows/push-prod.yml b/.github/workflows/push-prod.yml index beae084..8dacabb 100644 --- a/.github/workflows/push-prod.yml +++ b/.github/workflows/push-prod.yml @@ -104,7 +104,7 @@ jobs: cf_api: https://api.fr.cloud.gov cf_username: ${{secrets.PROD_CF_USERNAME}} cf_password: ${{secrets.PROD_CF_PASSWORD}} - cf_org: gsa-open-opportunities - cf_space: USDS + cf_org: gsa-tts-usdc + cf_space: prod cf_manifest: deployProd.yml cf_command: push assessment-tool -f deployProd.yml --strategy rolling -i 2 diff --git a/api/package.json b/api/package.json index a385085..ece45e6 100644 --- a/api/package.json +++ b/api/package.json @@ -16,9 +16,8 @@ "start:ts": "npm run build && node --inspect=0.0.0.0:9222 --nolazy build/server.js", "start:dev": "nodemon --watch 'src/**/*.ts' --exec \"npm run start:ts\"", "tunnel": "myapp_guid=$(cf app --guid $APP_NAME) && TUNNEL=$(cf curl /v2/apps/$myapp_guid/env | jq -r '[.system_env_json.VCAP_SERVICES.\"aws-rds\"[0].credentials | .host, .port] | join(\":\")') && echo 'Rat tunnel active' &&cf ssh -N -L 5432:$TUNNEL $APP_NAME", - "tunnel:stage": "APP_NAME=assessment-tool-stage npm run tunnel", - "tunnel:demo": "APP_NAME=smeqa-demo npm run tunnel", - "tunnel:prod": "APP_NAME=assessment-tool npm run tunnel", + "tunnel:stage": "APP_NAME=smeqa-stage npm run tunnel", + "tunnel:prod": "APP_NAME=smeqa-rr npm run tunnel", "watch": "tsc -w -p ." }, "keywords": [], diff --git a/deployDemo.yml b/deployDemo.yml deleted file mode 100644 index 8c7c855..0000000 --- a/deployDemo.yml +++ /dev/null @@ -1,17 +0,0 @@ -version: 1 -applications: - - name: smeqa-demo - instances: 1 - memory: 128MB - env: - NODE_ENV: production - APP_ENV: staging - OPTIMIZE_MEMORY: "true" - TZ: America/New_York - command: node server.js - type: nodejs - path: ./api/build - buildpack: nodejs_buildpack - stack: cflinuxfs3 - services: - - smeqa-demo-db diff --git a/deployDev.yml b/deployDev.yml deleted file mode 100644 index b577be7..0000000 --- a/deployDev.yml +++ /dev/null @@ -1,26 +0,0 @@ -version: 1 -applications: - - name: assessment-tool-dev - instances: 1 - memory: 128MB - #health-check-type: http - #health-check-http-endpoint: /api/admin/health - env: - NODE_ENV: production - APP_ENV: staging - OPTIMIZE_MEMORY: true - TZ: America/New_York - AUTH_CALLBACK_ROOT_URL: https://assessment-tool-dev.app.cloud.gov - LOG_LEVEL: trace - REDIRECT_URI: https://assessment-tool-dev.app.cloud.gov/login/auth - command: node server.js - type: nodejs - path: ./api/build - # properties: - # router: - # tracing: - # enable_zipkin: true - buildpack: nodejs_buildpack - stack: cflinuxfs4 - services: - - assessment-tool-dev-db diff --git a/deployProd.yml b/deployProd.yml index 6bd2116..ac2dc9d 100644 --- a/deployProd.yml +++ b/deployProd.yml @@ -1,14 +1,14 @@ version: 1 applications: - - name: assessment-tool + - name: smeqa-rr instances: 2 memory: 128MB #health-check-type: http #health-check-http-endpoint: /api/admin/health env: APP_ENV: production # this is used to point to different APIs/DBs/etc - AUTH_CALLBACK_URL_ROOT: https://assessment-tool.app.cloud.gov - REDIRECT_URI: https://assessment-tool.app.cloud.gov/login/auth + AUTH_CALLBACK_URL_ROOT: https://smeqa-rr.app.cloud.gov + REDIRECT_URI: https://smeqa-rr.app.cloud.gov/login/auth ISSUER_DISCOVER: https://secure.login.gov NODE_ENV: production OPTIMIZE_MEMORY: true @@ -28,4 +28,4 @@ applications: buildpack: nodejs_buildpack stack: cflinuxfs4 services: - - assessment-tool-db \ No newline at end of file + - smeqa-rr-db \ No newline at end of file diff --git a/deployStage.yml b/deployStage.yml index e2d896f..bb21c10 100644 --- a/deployStage.yml +++ b/deployStage.yml @@ -1,6 +1,6 @@ version: 1 applications: - - name: assessment-tool-stage + - name: smeqa-stage instances: 1 memory: 128MB #health-check-type: http @@ -10,9 +10,9 @@ applications: APP_ENV: staging OPTIMIZE_MEMORY: true TZ: America/New_York - AUTH_CALLBACK_ROOT_URL: https://assessment-tool-stage.app.cloud.gov + AUTH_CALLBACK_ROOT_URL: https://smeqa-stage.app.cloud.gov LOG_LEVEL: trace - REDIRECT_URI: https://assessment-tool-stage.app.cloud.gov/login/auth + REDIRECT_URI: https://smeqa-stage.app.cloud.gov/login/auth command: node server.js type: nodejs path: ./api/build @@ -23,4 +23,4 @@ applications: buildpack: nodejs_buildpack stack: cflinuxfs4 services: - - assessment-tool-stage-db + - smeqa-stage-db