-
Notifications
You must be signed in to change notification settings - Fork 15
125 lines (104 loc) · 3.4 KB
/
workflow.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
name: 'Continuous Integration for IBF'
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
detect-changes:
runs-on: ubuntu-latest
outputs:
ibf-api-service: ${{ steps.filter.outputs.ibf-api-service }}
ibf-dashboard: ${{ steps.filter.outputs.ibf-dashboard }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
ibf-api-service:
- "services/API-service/**"
ibf-dashboard:
- "interfaces/IBF-dashboard/**"
ibf-api-service:
needs: detect-changes
if: ${{ needs.detect-changes.outputs.ibf-api-service == 'true' }}
runs-on: ubuntu-latest
environment: test
env:
CERTBOT_EMAIL: ${{ vars.CERTBOT_EMAIL }}
FQDN: ${{ vars.FQDN }}
NODE_ENV: ${{ vars.NODE_ENV }}
ADMIN_PASSWORD: ${{ secrets.ADMIN_PASSWORD }}
SECRET: ${{ secrets.SECRET }}
RESET_SECRET: ${{ secrets.RESET_SECRET }}
MC_API: ${{ secrets.MC_API }}
LOCAL_PORT_IBF_SERVICE: ${{ vars.LOCAL_PORT_IBF_SERVICE }}
GEOSERVER_ADMIN_PASSWORD: ${{ secrets.GEOSERVER_ADMIN_PASSWORD }}
DB_HOST: ${{ vars.DB_HOST }}
DB_PORT: ${{ vars.DB_PORT }}
DB_USERNAME: ${{ vars.DB_USERNAME }}
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
DB_DATABASE: ${{ vars.DB_DATABASE }}
PRODUCTION_DATA_SERVER: ${{ vars.PRODUCTION_DATA_SERVER }}
WATERPOINTDATA_TOKEN: ${{ secrets.WATERPOINTDATA_TOKEN }}
COUNTRIES: ${{ vars.COUNTRIES }}
DISASTER_TYPES: ${{ vars.DISASTER_TYPES }}
strategy:
matrix:
node-version: [20.x]
defaults:
run:
working-directory: 'services/API-service'
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm ci --no-audit
- run: npm run lint
- run: npm test
- run: docker build . --file Dockerfile --tag ibf-api-service:$(date +%s)
- run: docker compose up -d
- run: docker compose exec ibf-api-service npm run test:api:all
ibf-dashboard:
needs: detect-changes
if: ${{ needs.detect-changes.outputs.ibf-dashboard == 'true' }}
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
defaults:
run:
working-directory: 'interfaces/IBF-dashboard'
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm ci --no-audit
- run: npm run lint
- run: npm test
- run: docker build . --file Dockerfile --tag ibf-dashboard:$(date +%s)
bump-version:
needs: [ibf-api-service, ibf-dashboard]
if: |
always() &&
github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- name: Wait for previous workflow to complete
uses: softprops/turnstyle@v2
with:
abort-after-seconds: 1800
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v4
- name: Bump version and push tag
uses: TriPSs/conventional-changelog-action@v5
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
git-message: 'chore(release): {version}'
release-count: 10