Skip to content

Merge pull request #603 from bga-admin/master #72

Merge pull request #603 from bga-admin/master

Merge pull request #603 from bga-admin/master #72

Workflow file for this run

name: CI
on:
push:
branches:
- master
- deploy
pull_request:
branches:
- master
jobs:
test:
name: Run tests
runs-on: ubuntu-20.04
services:
postgres:
image: postgres:10
env:
POSTGRES_DB: bga_payroll
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
redis:
image: redis
ports:
- 6379:6379
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.5
uses: actions/setup-python@v2
with:
# Semantic version range syntax or exact version of a Python version
python-version: '3.5'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools_scm
pip install -r requirements.txt
npm install -g jshint
- name: Test with pytest
run: |
cp configs/test_settings_deployment.py bga_database/local_settings.py
pytest -sv
jshint bga_database/static/js/*.js
deploy:
if:
contains('
refs/heads/master
refs/heads/deploy
', github.ref)
needs: test
name: Deploy to AWS
runs-on: ubuntu-20.04
steps:
- uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- uses: actions/checkout@v2
- id: deploy
uses: webfactory/create-aws-codedeploy-deployment@0d7a684950dae16883a140dd950257958730e0b5
with:
application: bga-payroll