Skip to content

Commit

Permalink
Merge pull request #239 from 18F/staging
Browse files Browse the repository at this point in the history
Production deploy 2/29
  • Loading branch information
levinmr authored Feb 29, 2024
2 parents f9c5cd2 + 3b293f0 commit 63b6495
Show file tree
Hide file tree
Showing 36 changed files with 5,597 additions and 8,367 deletions.
243 changes: 0 additions & 243 deletions .circleci/config.yml

This file was deleted.

3 changes: 0 additions & 3 deletions .eslintrc.yml

This file was deleted.

100 changes: 100 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
on:
push:
pull_request:

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Code checkout
uses: actions/checkout@v4
- name: Install node
uses: actions/setup-node@v4
with:
node-version: "lts/*"
cache: 'npm'
- name: Install node dependencies
run: npm ci
- name: Lint javascript
run: npm run lint
test:
needs: lint
runs-on: ubuntu-latest
# Start Postgres as a service, wait until healthy. Uses latest Postgres version.
services:
postgres:
image: postgres:latest
env:
POSTGRES_DB: analytics_reporter_test
POSTGRES_USER: analytics
POSTGRES_PASSWORD: 123abc
ports:
- 5432:5432
options:
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Code checkout
uses: actions/checkout@v4
- name: Install node
uses: actions/setup-node@v4
with:
node-version: "lts/*"
cache: 'npm'
- name: Install node dependencies
run: npm ci
- name: Run tests
run: npm test
deploy_dev:
needs:
- lint
- test
if: github.ref == 'refs/heads/develop'
uses: 18F/analytics-reporter-api/.github/workflows/deploy.yml@develop
with:
APP_NAME: ${{ vars.APP_NAME_DEV }}
CF_ORGANIZATION_NAME: ${{ vars.CF_ORGANIZATION_NAME }}
CF_SPACE_NAME: ${{ vars.CF_SPACE_NAME_DEV }}
DB_SERVICE_NAME: ${{ vars.DB_SERVICE_NAME_DEV }}
NEW_RELIC_APP_NAME: ${{ vars.NEW_RELIC_APP_NAME_DEV }}
secrets:
API_DATA_GOV_SECRET: ${{ secrets.API_DATA_GOV_SECRET_DEV }}
CF_USERNAME: ${{ secrets.CF_USERNAME_DEV }}
CF_PASSWORD: ${{ secrets.CF_PASSWORD_DEV }}
NEW_RELIC_LICENSE_KEY: ${{ secrets.NEW_RELIC_LICENSE_KEY_DEV }}
deploy_stg:
needs:
- lint
- test
if: github.ref == 'refs/heads/staging'
uses: 18F/analytics-reporter-api/.github/workflows/deploy.yml@develop
with:
APP_NAME: ${{ vars.APP_NAME_STG }}
CF_ORGANIZATION_NAME: ${{ vars.CF_ORGANIZATION_NAME }}
CF_SPACE_NAME: ${{ vars.CF_SPACE_NAME_STG }}
DB_SERVICE_NAME: ${{ vars.DB_SERVICE_NAME_STG }}
NEW_RELIC_APP_NAME: ${{ vars.NEW_RELIC_APP_NAME_STG }}
secrets:
API_DATA_GOV_SECRET: ${{ secrets.API_DATA_GOV_SECRET_STG }}
CF_USERNAME: ${{ secrets.CF_USERNAME_STG }}
CF_PASSWORD: ${{ secrets.CF_PASSWORD_STG }}
NEW_RELIC_LICENSE_KEY: ${{ secrets.NEW_RELIC_LICENSE_KEY_STG }}
deploy_prd:
needs:
- lint
- test
if: github.ref == 'refs/heads/master'
uses: 18F/analytics-reporter-api/.github/workflows/deploy.yml@develop
with:
APP_NAME: ${{ vars.APP_NAME_PRD }}
CF_ORGANIZATION_NAME: ${{ vars.CF_ORGANIZATION_NAME }}
CF_SPACE_NAME: ${{ vars.CF_SPACE_NAME_PRD }}
DB_SERVICE_NAME: ${{ vars.DB_SERVICE_NAME_PRD }}
NEW_RELIC_APP_NAME: ${{ vars.NEW_RELIC_APP_NAME_PRD }}
secrets:
API_DATA_GOV_SECRET: ${{ secrets.API_DATA_GOV_SECRET_PRD }}
CF_USERNAME: ${{ secrets.CF_USERNAME_PRD }}
CF_PASSWORD: ${{ secrets.CF_PASSWORD_PRD }}
NEW_RELIC_LICENSE_KEY: ${{ secrets.NEW_RELIC_LICENSE_KEY_PRD }}
Loading

0 comments on commit 63b6495

Please sign in to comment.