Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frontend - repo cleanup #779

Merged
merged 4 commits into from
Aug 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions .github/workflows/Continuous_Deployment_Frontend_Dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ on:
branches:
- dev
paths:
- 'src/**'
- 'public/**'
- 'client/**'

defaults:
run:
working-directory: client

jobs:
build:
Expand All @@ -20,14 +23,14 @@ jobs:
run: npm install
- name: Setup environment
run: |
echo MAPBOX_TOKEN=${{ secrets.MAPBOX_TOKEN }} > src/.env
echo MAPBOX_STREETS_URL=${{ secrets.MAPBOX_STREETS_URL }} >> src/.env
echo MAPBOX_SATELLITE_URL=${{ secrets.MAPBOX_SATELLITE_URL }} >> src/.env
echo API_URL=${{ secrets.API_URL_DEV }} >> src/.env
echo MIXPANEL_ENABLED=${{ secrets.MIXPANEL_ENABLED }} >> src/.env
echo MIXPANEL_TOKEN_PROD=${{ secrets.MIXPANEL_TOKEN_PROD }} >> src/.env
echo MIXPANEL_TOKEN_DEV=${{ secrets.MIXPANEL_TOKEN_DEV }} >> src/.env
echo GITHUB_SHA=${{ github.sha }} >> src/.env
echo MAPBOX_TOKEN=${{ secrets.MAPBOX_TOKEN }} > .env
echo MAPBOX_STREETS_URL=${{ secrets.MAPBOX_STREETS_URL }} >> .env
echo MAPBOX_SATELLITE_URL=${{ secrets.MAPBOX_SATELLITE_URL }} >> .env
echo API_URL=${{ secrets.API_URL_DEV }} >> .env
echo MIXPANEL_ENABLED=${{ secrets.MIXPANEL_ENABLED }} >> .env
echo MIXPANEL_TOKEN_PROD=${{ secrets.MIXPANEL_TOKEN_PROD }} >> .env
echo MIXPANEL_TOKEN_DEV=${{ secrets.MIXPANEL_TOKEN_DEV }} >> .env
echo GITHUB_SHA=${{ github.sha }} >> .env
- name: Build project
run: npm run build
- name: Configure AWS Credentials
Expand Down
23 changes: 13 additions & 10 deletions .github/workflows/Continuous_Deployment_Frontend_Prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ on:
branches:
- master
paths:
- 'src/**'
- 'public/**'
- 'client/**'

defaults:
run:
working-directory: client

jobs:
build:
Expand All @@ -20,14 +23,14 @@ jobs:
run: npm install
- name: Setup environment
run: |
echo MAPBOX_TOKEN=${{ secrets.MAPBOX_TOKEN }} > src/.env
echo MAPBOX_STREETS_URL=${{ secrets.MAPBOX_STREETS_URL }} >> src/.env
echo MAPBOX_SATELLITE_URL=${{ secrets.MAPBOX_SATELLITE_URL }} >> src/.env
echo API_URL=${{ secrets.API_URL_PROD }} >> src/.env
echo MIXPANEL_ENABLED=${{ secrets.MIXPANEL_ENABLED }} >> src/.env
echo MIXPANEL_TOKEN_PROD=${{ secrets.MIXPANEL_TOKEN_PROD }} >> src/.env
echo MIXPANEL_TOKEN_DEV=${{ secrets.MIXPANEL_TOKEN_DEV }} >> src/.env
echo GITHUB_SHA=${{ github.sha }} >> src/.env
echo MAPBOX_TOKEN=${{ secrets.MAPBOX_TOKEN }} > .env
echo MAPBOX_STREETS_URL=${{ secrets.MAPBOX_STREETS_URL }} >> .env
echo MAPBOX_SATELLITE_URL=${{ secrets.MAPBOX_SATELLITE_URL }} >> .env
echo API_URL=${{ secrets.API_URL_PROD }} >> .env
echo MIXPANEL_ENABLED=${{ secrets.MIXPANEL_ENABLED }} >> .env
echo MIXPANEL_TOKEN_PROD=${{ secrets.MIXPANEL_TOKEN_PROD }} >> .env
echo MIXPANEL_TOKEN_DEV=${{ secrets.MIXPANEL_TOKEN_DEV }} >> .env
echo GITHUB_SHA=${{ github.sha }} >> .env
- name: Build project
run: npm run build
- name: Configure AWS Credentials
Expand Down
21 changes: 12 additions & 9 deletions .github/workflows/Continuous_Integration_Frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ name: CI_Frontend
on:
pull_request:
paths:
- 'src/**'
- 'public/**'
- 'client/**'

defaults:
run:
working-directory: client

jobs:
build:
Expand All @@ -17,13 +20,13 @@ jobs:
run: npm run lint
- name: Setup environment
run: |
echo MAPBOX_TOKEN=${{ secrets.MAPBOX_TOKEN }} > src/.env
echo MAPBOX_STREETS_URL=${{ secrets.MAPBOX_STREETS_URL }} >> src/.env
echo MAPBOX_SATELLITE_URL=${{ secrets.MAPBOX_SATELLITE_URL }} >> src/.env
echo API_URL=${{ secrets.API_URL_PROD }} >> src/.env
echo MIXPANEL_ENABLED=${{ secrets.MIXPANEL_ENABLED }} >> src/.env
echo MIXPANEL_TOKEN_PROD=${{ secrets.MIXPANEL_TOKEN_PROD }} >> src/.env
echo MIXPANEL_TOKEN_DEV=${{ secrets.MIXPANEL_TOKEN_DEV }} >> src/.env
echo MAPBOX_TOKEN=${{ secrets.MAPBOX_TOKEN }} > .env
echo MAPBOX_STREETS_URL=${{ secrets.MAPBOX_STREETS_URL }} >> .env
echo MAPBOX_SATELLITE_URL=${{ secrets.MAPBOX_SATELLITE_URL }} >> .env
echo API_URL=${{ secrets.API_URL_PROD }} >> .env
echo MIXPANEL_ENABLED=${{ secrets.MIXPANEL_ENABLED }} >> .env
echo MIXPANEL_TOKEN_PROD=${{ secrets.MIXPANEL_TOKEN_PROD }} >> .env
echo MIXPANEL_TOKEN_DEV=${{ secrets.MIXPANEL_TOKEN_DEV }} >> .env
- name: Build project
run: npm run build
- name: Run Tests
Expand Down
6 changes: 0 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@

dist/

# Test results
coverage/

Expand All @@ -22,10 +20,6 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*

/package-lock.json

node_modules_non_es5

# config
config.js
.env
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 9 additions & 0 deletions client/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# secrets
.env

# dependencies
/node_modules/
node_modules_non_es5

# production build
dist/
File renamed without changes.
6 changes: 3 additions & 3 deletions src/README.md → client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

### Setting up the project for the first time?

- `npm run setup` to install front end dependencies and create an `.env` file
- From this directory, `npm run setup` to install front end dependencies and create an `.env` file
- get a [Mapbox](https://account.mapbox.com/auth/signin/) API token and add that to your `.env` file as the `MAPBOX_TOKEN`
- get the `API_URL` from a team member and add that to your `.env` file

Setup complete!

### Development

- `npm start` to check your `.env` file and start webpack dev server
- From this directory, `npm start` to check your `.env` file and start webpack dev server

Your browser should open to `0.0.0.0:3000` and the site should render. Webpack will detect saved code changes, rebuild the bundle in memory, and update the site in your browser.

Expand All @@ -23,5 +23,5 @@ npm run check-env # checks .env file exists and has all required key
npm start # check .env file and start webpack dev server
npm run dev # start webpack dev server (no .env check)
npm run build # run webpack in production mode - output is placed in dist directory
npm run lint # lint javascript in src directory
npm run lint # lint javascript in client directory
```
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading