forked from dasch-swiss/beol
-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (72 loc) · 2.17 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
name: CI
env:
NV: 18.10.x # node version
on:
push:
release:
types: [published]
jobs:
test:
name: Test the app
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Node.js ${{ env.NV }}
uses: actions/setup-node@v1
with:
node-version: ${{ env.NV }}
- name: Install dependencies
run: npm install
- name: Run Unit Tests
run: npm run test-ci
build:
name: Build the app
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Node.js ${{ env.NV }}
uses: actions/setup-node@v1
with:
node-version: ${{ env.NV }}
- name: Install dependencies
run: npm install
- name: Build in prod mode
run: docker build .
release-please:
name: Prepare next release
runs-on: ubuntu-latest
# Automate releases with Conventional Commit Messages as Pull Requests are merged into "develop" branch
if: github.ref == 'refs/heads/develop'
steps:
- name: Get release please action
uses: GoogleCloudPlatform/release-please-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: node
package-name: beol
changelog-types: '[
{"type": "feat", "section": "Enhancements", "hidden": false },
{"type": "fix", "section": "Bug Fixes", "hidden": false },
{"type": "chore", "section": "Maintenance", "hidden": false },
{"type": "refactor", "section": "Maintenance", "hidden": false },
{"type": "docs", "section": "Documentation", "hidden": false }
]'
# publish only on release
publish:
name: Publish to Dockerhub
needs: [
build,
test
]
runs-on: ubuntu-latest
if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags')
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: docker/setup-buildx-action@v2
- uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- run: make publish-beol-image