-
-
Notifications
You must be signed in to change notification settings - Fork 104
143 lines (111 loc) · 3.69 KB
/
ci.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
name: CI
on:
push:
branches:
- master
pull_request:
schedule:
- cron: '0 3 * * *' # daily, at 3am
jobs:
frontend:
name: Frontend
runs-on: ubuntu-latest
env:
COVERAGE: true
JOBS: 1 # See https://git.io/vdao3 for details.
# Percy secrets are included here to enable Percy's GitHub integration
# on community-submitted PRs
PERCY_PROJECT: skylines/skylines
PERCY_TOKEN: 81bf0245987c87eb4924eae0b085cb60596f2f0f4d4ffe27e171828535aa6812
steps:
- uses: actions/checkout@v2
- uses: volta-cli/action@v1
- run: yarn install --frozen-lockfile
working-directory: ./ember
- run: npx bower install
working-directory: ./ember
- run: yarn lint:js
working-directory: ./ember
- run: yarn lint:hbs
working-directory: ./ember
- run: yarn ember dependency-lint
working-directory: ./ember
- uses: percy/[email protected]
with:
command: yarn test
working-directory: ./ember
embroider:
name: Frontend (embroider)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: volta-cli/action@v1
- run: yarn install --frozen-lockfile
working-directory: ./ember
- run: npx bower install
working-directory: ./ember
- run: yarn ember build
working-directory: ./ember
continue-on-error: true
env:
USE_EMBROIDER: true
backend:
name: Backend
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [2.7, 3.6]
steps:
- uses: actions/checkout@v2
# Build Docker images
- run: docker-compose build --build-arg PYTHON_VERSION=${{ matrix.python-version }}
# Run the test suite
- run: docker-compose run api pipenv run py.test -vv --color=yes --cov=skylines --cov-report term-missing:skip-covered
backend-lint:
name: Backend (Lint)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.6
- run: pip install black==20.8b1
- run: black config migrations skylines tests *.py --check
deploy:
name: Deploy
runs-on: ubuntu-latest
needs: [frontend, backend, backend-lint]
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
steps:
- name: Start deployment
uses: bobheadxi/[email protected]
id: deployment
with:
step: start
token: ${{ secrets.GITHUB_TOKEN }}
env: production
- uses: actions/checkout@v2
- uses: volta-cli/action@v1
- run: yarn install --frozen-lockfile
working-directory: ./ember
- run: npx bower install
working-directory: ./ember
- uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Adjust ~/.ssh/known_hosts file
run: echo '[skylines.aero]:2222,[212.51.149.149]:2222 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEoPRdvULvcpU92D9NbU3Yan0J9DUkX5S5OnZ/V28rbZH32uWRKemIHunXpHskoPC75nmsa12uDXxtsH02epgNc=' > ~/.ssh/known_hosts
- run: yarn ember deploy production --activate --verbose
working-directory: ./ember
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
- name: Update deployment status
uses: bobheadxi/[email protected]
if: always()
with:
step: finish
token: ${{ secrets.GITHUB_TOKEN }}
status: ${{ job.status }}
env_url: https://skylines.aero/
deployment_id: ${{ steps.deployment.outputs.deployment_id }}