Merge pull request #825 from security-force-monitor/hcg/mm-import #350
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- master | |
- deploy | |
- numbersix | |
pull_request: | |
branches: | |
- master | |
jobs: | |
test: | |
name: Run tests | |
runs-on: ubuntu-20.04 | |
services: | |
postgres: | |
image: postgis/postgis:12-3.2 | |
env: | |
POSTGRES_DB: sfm | |
POSTGRES_PASSWORD: postgres | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 5432:5432 | |
env: | |
DATABASE_URL: postgis://postgres:postgres@localhost:5432/sfm | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v2 | |
with: | |
# Semantic version range syntax or exact version of a Python version | |
python-version: '3.8' | |
- name: Install dependencies | |
run: | | |
sudo apt update | |
sudo apt install -y gdal-bin | |
python -m pip install --upgrade pip setuptools | |
pip install -r requirements.txt | |
- name: Copy settings_local.py | |
run: | | |
cp sfm_pc/settings_local.example.py sfm_pc/settings_local.py | |
- name: Test with pytest | |
run: | | |
pytest -sv | |
build: | |
needs: test | |
name: Compile RTL CSS | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install dependencies and generate CSS | |
run: | | |
npm install rtlcss | |
npm run rtl | |
- name: Commit generated CSS | |
uses: EndBug/add-and-commit@v7 | |
with: | |
default_author: github_actions | |
add: 'static/css/*.rtl.css --force' | |
message: 'Update *.rtl.css' | |
deploy: | |
needs: test | |
name: Deploy to AWS | |
runs-on: ubuntu-latest | |
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@0.2.2 | |
with: | |
application: whowasincommand |