-
Notifications
You must be signed in to change notification settings - Fork 0
176 lines (145 loc) Β· 4.05 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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
name: Continuous Integration
on: push
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
install_cache:
name: Install code and deps
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
node:
- 18
steps:
- name: Checkout π
uses: actions/checkout@master
- uses: ./.github/actions/install
lint:
needs: install_cache
name: Lint code base
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
node:
- 18
steps:
- name: Checkout π
uses: actions/checkout@master
- uses: ./.github/actions/install
- name: Run linter π
run: yarn lint
cypress:
needs: install_cache
name: Cypress
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
node:
- 18
steps:
- name: Checkout π
uses: actions/checkout@master
- uses: ./.github/actions/install
- name: Install ruby
run: |
sudo apt-get install -y ruby &&
ruby poi_explode.rb cypress/fixtures/teritorio/references/pois.geojson
- name: Prepare
run: |
cp -R cypress/fixtures/ public/fixtures &&
CONFIG=vidos-config-cypress.json CYPRESS=true yarn build
- name: Run Cypress Tests π§ͺ
uses: cypress-io/github-action@v5
env:
CONFIG: ../vidos-config-cypress.json
CYPRESS: true
with:
install-command: yarn --silent
start: yarn start
wait-on: 'http://127.0.0.1:3000'
wait-on-timeout: 30
- name: Keep failled cypress-screenshots
uses: actions/upload-artifact@v3
if: failure()
with:
name: cypress-screenshots
path: cypress/screenshots
histoire:
needs: install_cache
name: Histoire
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
node:
- 18
steps:
- name: Checkout π
uses: actions/checkout@master
- uses: ./.github/actions/install
- name: Install more packages
run: |
sudo apt-get install -y ruby &&
ruby poi_explode.rb cypress/fixtures/teritorio/references/pois.geojson
- name: Test Histoire
run: |
CONFIG=vidos-config-empty.json yarn prepare &&
CONFIG=vidos-config-empty.json yarn test:histoire
- name: Keep failled histoire-screenshots
uses: actions/upload-artifact@v3
if: failure()
with:
name: histoire-screenshots
path: __screenshots__
- name: Deploy to gh-pages
if: github.ref == 'refs/heads/develop'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./.histoire/dist
deploy_dev:
needs:
- install_cache
- lint
- cypress
- histoire
if: github.ref == 'refs/heads/develop'
name: Deploy Dev
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
node:
- 18
steps:
- name: Checkout π
uses: actions/checkout@master
- name: Deploy
uses: appleboy/[email protected]
with:
host: ${{secrets.DEPLOY_SSH_HOST}}
username: ${{secrets.DEPLOY_SSH_USERNAME}}
key: ${{secrets.DEPLOY_SSH_KEY_DEV}}
port: 2222
script: |
echo -n 'VIDO: Deployment started at: ' &&
date -u &&
cd ${{secrets.DEPLOY_SSH_PATH}} &&
git fetch &&
git checkout -f origin/develop &&
ruby poi_explode.rb cypress/fixtures/teritorio/references/pois.geojson &&
docker-compose build &&
touch vidos-config.json &&
docker-compose run --rm vido yarn build-config &&
docker-compose up -d &&
echo -n 'VIDO: Deployment completed at: ' &&
date -u