Skip to content

Commit 63b6495

Browse files
authored
Merge pull request #239 from 18F/staging
Production deploy 2/29
2 parents f9c5cd2 + 3b293f0 commit 63b6495

36 files changed

+5597
-8367
lines changed

.circleci/config.yml

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

.eslintrc.yml

Lines changed: 0 additions & 3 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 node 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+
# Start Postgres as a service, wait until healthy. 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 node 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+
CF_ORGANIZATION_NAME: ${{ vars.CF_ORGANIZATION_NAME }}
59+
CF_SPACE_NAME: ${{ vars.CF_SPACE_NAME_DEV }}
60+
DB_SERVICE_NAME: ${{ vars.DB_SERVICE_NAME_DEV }}
61+
NEW_RELIC_APP_NAME: ${{ vars.NEW_RELIC_APP_NAME_DEV }}
62+
secrets:
63+
API_DATA_GOV_SECRET: ${{ secrets.API_DATA_GOV_SECRET_DEV }}
64+
CF_USERNAME: ${{ secrets.CF_USERNAME_DEV }}
65+
CF_PASSWORD: ${{ secrets.CF_PASSWORD_DEV }}
66+
NEW_RELIC_LICENSE_KEY: ${{ secrets.NEW_RELIC_LICENSE_KEY_DEV }}
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+
CF_ORGANIZATION_NAME: ${{ vars.CF_ORGANIZATION_NAME }}
76+
CF_SPACE_NAME: ${{ vars.CF_SPACE_NAME_STG }}
77+
DB_SERVICE_NAME: ${{ vars.DB_SERVICE_NAME_STG }}
78+
NEW_RELIC_APP_NAME: ${{ vars.NEW_RELIC_APP_NAME_STG }}
79+
secrets:
80+
API_DATA_GOV_SECRET: ${{ secrets.API_DATA_GOV_SECRET_STG }}
81+
CF_USERNAME: ${{ secrets.CF_USERNAME_STG }}
82+
CF_PASSWORD: ${{ secrets.CF_PASSWORD_STG }}
83+
NEW_RELIC_LICENSE_KEY: ${{ secrets.NEW_RELIC_LICENSE_KEY_STG }}
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+
CF_ORGANIZATION_NAME: ${{ vars.CF_ORGANIZATION_NAME }}
93+
CF_SPACE_NAME: ${{ vars.CF_SPACE_NAME_PRD }}
94+
DB_SERVICE_NAME: ${{ vars.DB_SERVICE_NAME_PRD }}
95+
NEW_RELIC_APP_NAME: ${{ vars.NEW_RELIC_APP_NAME_PRD }}
96+
secrets:
97+
API_DATA_GOV_SECRET: ${{ secrets.API_DATA_GOV_SECRET_PRD }}
98+
CF_USERNAME: ${{ secrets.CF_USERNAME_PRD }}
99+
CF_PASSWORD: ${{ secrets.CF_PASSWORD_PRD }}
100+
NEW_RELIC_LICENSE_KEY: ${{ secrets.NEW_RELIC_LICENSE_KEY_PRD }}

0 commit comments

Comments
 (0)