mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-06 03:13:42 -05:00
2767 passing
This commit is contained in:
51
.github/workflows/checks.yml
vendored
Normal file
51
.github/workflows/checks.yml
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
name: Run checks
|
||||
|
||||
on: [push]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
NOTIFY_ENVIRONMENT: test
|
||||
FLASK_APP: application.py
|
||||
FLASK_ENV: development
|
||||
WERKZEUG_DEBUG_PIN: off
|
||||
REDIS_URL: redis://adminredis:6379/0
|
||||
DEV_REDIS_URL: redis://adminredis:6379/0
|
||||
REDIS_ENABLED: False
|
||||
ANTIVIRUS_ENABLED: 0
|
||||
NODE_VERSION: 16.15.1
|
||||
ADMIN_CLIENT_ID: notify-admin
|
||||
ADMIN_CLIENT_USERNAME: notify-admin
|
||||
ADMIN_CLIENT_SECRET: dev-notify-secret-key
|
||||
GOVUK_ALERTS_CLIENT_ID: govuk-alerts
|
||||
ADMIN_BASE_URL: http://localhost:6012
|
||||
API_HOST_NAME: http://localhost:6011
|
||||
DEV_API_HOST_NAME: http://localhost:6011
|
||||
AWS_REGION: us-west-2
|
||||
BASIC_AUTH_USERNAME: curiousabout
|
||||
BASIC_AUTH_PASSWORD: the10xnotifybeta
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Install container dependencies
|
||||
run: |
|
||||
sudo apt-get update \
|
||||
&& sudo apt-get install -y --no-install-recommends \
|
||||
libcurl4-openssl-dev
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up Python 3.9
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: "3.9"
|
||||
- name: Install application dependencies
|
||||
run: make bootstrap
|
||||
# - name: Run style checks
|
||||
# run: flake8 .
|
||||
# - name: Check imports alphabetized
|
||||
# run: isort --check-only ./app ./tests
|
||||
- name: Run tests
|
||||
run: pytest -n4 --maxfail=10
|
||||
58
.github/workflows/deploy.yml
vendored
Normal file
58
.github/workflows/deploy.yml
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
name: Deploy to prototype environment
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: [ Run checks ]
|
||||
types:
|
||||
- completed
|
||||
branches: [ main ] # Redundant, workflow_run events are only triggered on default branch (`main`)
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
||||
|
||||
steps:
|
||||
- name: Install container dependencies
|
||||
run: |
|
||||
sudo apt-get update \
|
||||
&& sudo apt-get install -y --no-install-recommends \
|
||||
libcurl4-openssl-dev
|
||||
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Python 3.9
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: "3.9"
|
||||
|
||||
- name: Install application dependencies
|
||||
run: make bootstrap
|
||||
|
||||
- name: Deploy to cloud.gov
|
||||
uses: 18f/cg-deploy-action@main
|
||||
env:
|
||||
DANGEROUS_SALT: ${{ secrets.DANGEROUS_SALT }}
|
||||
SECRET_KEY: ${{ secrets.SECRET_KEY }}
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||
with:
|
||||
cf_username: ${{ secrets.cloudgov_username }}
|
||||
cf_password: ${{ secrets.cloudgov_password }}
|
||||
cf_org: gsa-10x-prototyping
|
||||
cf_space: 10x-notifications
|
||||
full_command: |
|
||||
cf push --strategy rolling \
|
||||
--var DANGEROUS_SALT="$DANGEROUS_SALT" \
|
||||
--var SECRET_KEY="$SECRET_KEY" \
|
||||
--var AWS_ACCESS_KEY_ID="$AWS_ACCESS_KEY_ID" \
|
||||
--var AWS_SECRET_ACCESS_KEY="$AWS_SECRET_ACCESS_KEY"
|
||||
|
||||
bail:
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
|
||||
steps:
|
||||
- run: echo 'Checks failed, not deploying'
|
||||
Reference in New Issue
Block a user