Skip to content

Commit e4299eb

Browse files
authored
Merge pull request #237 from 18F/develop
Staging deployment
2 parents 1552533 + a1380ed commit e4299eb

31 files changed

+1562
-2563
lines changed

.circleci/config.yml

Lines changed: 0 additions & 243 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
on:
2+
push:
3+
pull_request:
4+
5+
jobs:
6+
lint:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Code Checkout
10+
uses: actions/checkout@v4
11+
- name: Install Node
12+
uses: actions/setup-node@v4
13+
with:
14+
node-version: "lts/*"
15+
cache: 'npm'
16+
- name: install dependencies
17+
run: npm ci
18+
- name: lint javascript
19+
run: npm run lint
20+
test:
21+
needs: lint
22+
runs-on: ubuntu-latest
23+
#Spin up postgres as a service, wait till healthy before moving on. Uses latest Postgres Version.
24+
services:
25+
postgres:
26+
image: postgres:latest
27+
env:
28+
POSTGRES_DB: analytics_reporter_test
29+
POSTGRES_USER: analytics
30+
POSTGRES_PASSWORD: 123abc
31+
ports:
32+
- 5432:5432
33+
options:
34+
--health-cmd pg_isready
35+
--health-interval 10s
36+
--health-timeout 5s
37+
--health-retries 5
38+
steps:
39+
- name: Code Checkout
40+
uses: actions/checkout@v4
41+
- name: Install Node
42+
uses: actions/setup-node@v4
43+
with:
44+
node-version: "lts/*"
45+
cache: 'npm'
46+
- name: install dependencies
47+
run: npm ci
48+
- name: run tests
49+
run: npm test
50+
deploy_dev:
51+
needs:
52+
- lint
53+
- test
54+
if: github.ref == 'refs/heads/develop'
55+
uses: 18F/analytics-reporter-api/.github/workflows/deploy.yml@develop
56+
with:
57+
APP_NAME: ${{ vars.APP_NAME_DEV }}
58+
DB_NAME: ${{ vars.DB_NAME_DEV }}
59+
NEW_RELIC_APP_NAME:
60+
ORGANIZATION_NAME: gsa-opp-analytics
61+
SPACE_NAME: analytics-dev
62+
secrets:
63+
CF_USERNAME: ${{ secrets.CF_USERNAME_DEV }}
64+
CF_PASSWORD: ${{ secrets.CF_PASSWORD_DEV }}
65+
API_DATA_GOV_SECRET: ${{ secrets.API_DATA_GOV_SECRET_DEV }}
66+
NEW_RELIC_LICENSE_KEY:
67+
deploy_stg:
68+
needs:
69+
- lint
70+
- test
71+
if: github.ref == 'refs/heads/staging'
72+
uses: 18F/analytics-reporter-api/.github/workflows/deploy.yml@develop
73+
with:
74+
APP_NAME: ${{ vars.APP_NAME_STG }}
75+
DB_NAME: ${{ vars.DB_NAME_STG }}
76+
NEW_RELIC_APP_NAME:
77+
ORGANIZATION_NAME: gsa-opp-analytics
78+
SPACE_NAME: analytics-staging
79+
secrets:
80+
CF_USERNAME: ${{ secrets.CF_USERNAME_STG }}
81+
CF_PASSWORD: ${{ secrets.CF_PASSWORD_STG }}
82+
API_DATA_GOV_SECRET: ${{ secrets.API_DATA_GOV_SECRET_STG }}
83+
NEW_RELIC_LICENSE_KEY:
84+
deploy_prd:
85+
needs:
86+
- lint
87+
- test
88+
if: github.ref == 'refs/heads/master'
89+
uses: 18F/analytics-reporter-api/.github/workflows/deploy.yml@develop
90+
with:
91+
APP_NAME: ${{ vars.APP_NAME_PRD }}
92+
DB_NAME: ${{ vars.DB_NAME_PRD }}
93+
NEW_RELIC_APP_NAME: ${{ vars.NEW_RELIC_APP_NAME_PRD }}
94+
ORGANIZATION_NAME: gsa-opp-analytics
95+
SPACE_NAME: analytics-production
96+
secrets:
97+
CF_USERNAME: ${{ secrets.CF_USERNAME_PRD }}
98+
CF_PASSWORD: ${{ secrets.CF_PASSWORD_PRD }}
99+
API_DATA_GOV_SECRET: ${{ secrets.API_DATA_GOV_SECRET_PRD }}
100+
NEW_RELIC_LICENSE_KEY: ${{ secrets.NEW_RELIC_LICENSE_KEY_PRD }}

0 commit comments

Comments
 (0)