-
Notifications
You must be signed in to change notification settings - Fork 0
178 lines (175 loc) · 5.85 KB
/
Copy pathnode.js.yml
File metadata and controls
178 lines (175 loc) · 5.85 KB
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
177
178
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Node.js CI
on:
push:
branches:
- develop
- main
pull_request:
branches:
- develop
- main
jobs:
test:
name: Lint, test and coverage to coveralls
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [21.x]
redis-version: [6]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Start Redis
uses: supercharge/redis-github-action@1.2.0
with:
redis-version: ${{ matrix.redis-version }}
- name: Install dependencies
run: npm ci
# - name: Check syntax
# run: npm run lint
# env:
# CI: true
- name: Run tests
run: npm run test
env:
CI: true
# - name: Generate coverage report
# run: npm run coverage
# env:
# CI: true
# - name: Coverage to Coveralls
# uses: coverallsapp/github-action@master
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# env:
# CI: true
# e2eTest:
# name: (develop) E2E - Checkout infrastructure, install mocha and run tests (docker-compose up, mocha tests and docker-compose down)
# needs: buildTest
# runs-on: ubuntu-latest
# strategy:
# matrix:
# node-version: [14.x]
# steps:
# - uses: actions/checkout@v2
# with:
# repository: governify/bluejay-infrastructure
# ref: refs/heads/develop
# - name: Use Node.js ${{ matrix.node-version }}
# uses: actions/setup-node@v1
# with:
# node-version: ${{ matrix.node-version }}
# - name: Install dependencies
# run: npm ci
# - name: Add host.docker.internal association to 172.17.0.1
# run: sudo echo "172.17.0.1 host.docker.internal" | sudo tee -a /etc/hosts
# - name: Run tests
# run: npm run test
# env:
# CI: true
# e2eMain:
# name: (main) E2E - Checkout infrastructure, install mocha and run tests (docker-compose up, mocha tests and docker-compose down)
# if: ${{ github.ref == 'refs/heads/main' }}
# needs: test
# runs-on: ubuntu-latest
# strategy:
# matrix:
# node-version: [14.x]
# steps:
# - uses: actions/checkout@v2
# with:
# repository: governify/bluejay-infrastructure
# ref: refs/heads/develop
# - name: Use Node.js ${{ matrix.node-version }}
# uses: actions/setup-node@v1
# with:
# node-version: ${{ matrix.node-version }}
# - name: Install dependencies
# run: npm ci
# - name: Add host.docker.internal association to 172.17.0.1
# run: sudo echo "172.17.0.1 host.docker.internal" | sudo tee -a /etc/hosts
# - name: Run tests
# run: npm run test
# env:
# CI: true
buildTest:
name: Build and push to dockerhub using develop tag
if: ${{ github.ref == 'refs/heads/develop' && github.event_name == 'push' }}
needs: test
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
tags: governify/scope-manager:develop
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
buildProdAndRelease:
name: Release, build and push to dockerhub using tag version
if: ${{ github.ref == 'refs/heads/main' && github.event_name == 'push'}}
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Conventional Changelog
id: changelog
uses: TriPSs/conventional-changelog-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
output-file: 'CHANGELOG.md'
tag-prefix: 'v'
release-count: 0
package-json: './package.json'
- name: Create Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.github_token }}
with:
tag_name: ${{ steps.changelog.outputs.tag }}
release_name: ${{ steps.changelog.outputs.tag }}
body: ${{ steps.changelog.outputs.clean_changelog }}
- name: Sync develop with main
uses: repo-sync/pull-request@v2
with:
source_branch: "main"
destination_branch: "develop"
pr_title: "Synchronize develop with master after release ${{ steps.changelog.outputs.tag }}"
pr_body: ":crown:"
pr_reviewer: "pafmon"
pr_assignee: "cesgarpas"
pr_label: "auto-pr"
github_token: ${{ secrets.GITHUB_TOKEN }}
- uses: AutoModality/action-clean@v1
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
tags: governify/scope-manager:${{ steps.changelog.outputs.tag }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}