Skip to content

Fixed issue of HMW banner over top of EPA template slide out menu. #137

Fixed issue of HMW banner over top of EPA template slide out menu.

Fixed issue of HMW banner over top of EPA template slide out menu. #137

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: Dev Deploy
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch branches: [ develop ]
push:
branches: [ develop ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
changes:
# The type of runner that the job will run on
runs-on: ubuntu-latest
environment: dev
outputs:
workflows: ${{ steps.filter.outputs.workflows }}
app: ${{ steps.filter.outputs.app }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
workflows:
- '.github/workflows/dev.yml'
app:
- 'app/**'
app:
# Check if this folder has any changes
needs: changes
if: ${{
needs.changes.outputs.app == 'true' ||
needs.changes.outputs.workflows == 'true' }}
# The type of runner that the job will run on
runs-on: ubuntu-latest
environment: dev
# Set environment variables
env:
APP_NAME: mywaterway-dev
CF_ORG: ${{ secrets.CF_ORG }}
CF_SPACE: ${{ secrets.CF_SPACE_DEV }}
CF_STACK: cflinuxfs4
CF_USER_DEV: ${{ secrets.CF_USER_DEV }}
CF_PASSWORD_DEV: ${{ secrets.CF_PASSWORD_DEV }}
CF_S3_PUB_ACCESS_KEY: ${{ secrets.CF_DEV_S3_PUB_ACCESS_KEY }}
CF_S3_PUB_BUCKET_ID: ${{ secrets.CF_DEV_S3_PUB_BUCKET_ID }}
CF_S3_PUB_REGION: ${{ secrets.CF_DEV_S3_PUB_REGION }}
CF_S3_PUB_SECRET_KEY: ${{ secrets.CF_DEV_S3_PUB_SECRET_KEY }}
GLOSSARY_AUTH: ${{ secrets.GLOSSARY_AUTH }}
HMW_BASIC_USER_NAME: ${{ secrets.HMW_BASIC_USER_NAME }}
HMW_BASIC_USER_PWD: ${{ secrets.HMW_BASIC_USER_PWD }}
REACT_APP_ARCGIS_CLIENT_ID: ${{ secrets.REACT_APP_ARCGIS_CLIENT_ID_DEV }}
SERVER_URL: https://mywaterway-dev.app.cloud.gov
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
# Set up node and npm
- uses: actions/setup-node@v3
# Run front-end processes (install, lint, test, bundle)
- name: Cache node modules
uses: actions/cache@v3
with:
path: ~/client/.npm
key: v1-npm-client-deps-${{ hashFiles('**/client/package-lock.json') }}
restore-keys: v1-npm-client-deps-
- name: Install front-end dependencies
run: npm install --legacy-peer-deps
working-directory: app/client
- name: Build front-end files and move to server
run: |
REACT_APP_ARCGIS_CLIENT_ID="$REACT_APP_ARCGIS_CLIENT_ID" \
npm run build
cd build
cp -r * ../../server/app/public
rm -rf *
working-directory: app/client
# Run CloudFoundry/Cloud.gov deployment
- name: Set up Cloud Foundry CLI
run: |
curl -v -L -o cf-cli_amd64.deb 'https://cli.run.pivotal.io/stable?release=debian64&version=v7&source=github'
sudo dpkg -i cf-cli_amd64.deb
cf -v
cf api https://api.fr.cloud.gov
cf auth "$CF_USER_DEV" "$CF_PASSWORD_DEV"
cf target -o "$CF_ORG" -s "$CF_SPACE"
- name: Set application-level variables
run: |
cf set-env $APP_NAME "GLOSSARY_AUTH" "$GLOSSARY_AUTH" > /dev/null
cf set-env $APP_NAME "HMW_BASIC_USER_NAME" "$HMW_BASIC_USER_NAME" > /dev/null
cf set-env $APP_NAME "HMW_BASIC_USER_PWD" "$HMW_BASIC_USER_PWD" > /dev/null
cf set-env $APP_NAME "TZ" "America/New_York" > /dev/null
- name: Configure Public AWS Credentials
uses: aws-actions/configure-aws-credentials@v1-node16
with:
aws-access-key-id: ${{ env.CF_S3_PUB_ACCESS_KEY }}
aws-secret-access-key: ${{ env.CF_S3_PUB_SECRET_KEY }}
aws-region: ${{ env.CF_S3_PUB_REGION }}
# Sync static content to public S3 bucket
- name: Sync static content to S3
run: aws s3 sync . s3://$CF_S3_PUB_BUCKET_ID/data
working-directory: app/server/app/public/data
# Set CORS configuration for public S3 bucket
- name: Set public S3 CORS configuration
run: aws s3api put-bucket-cors --bucket $CF_S3_PUB_BUCKET_ID --cors-configuration file://s3CORS.json
working-directory: app/server/app/config
# Now that front-end is built in server/dist, only push server dir to Cloud.gov
- name: Deploy application to Cloud.gov
run: cf push $APP_NAME --strategy rolling -f ../manifest-dev.yml -p . -t 180 -s $CF_STACK
working-directory: app/server