forked from caravancoop/sfm
-
Notifications
You must be signed in to change notification settings - Fork 3
83 lines (79 loc) · 2.08 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
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