75 lines (71 loc) · 2.21 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
name: CI
on:
push:
release:
types: [published]
jobs:
build-test:
name: Build and Test
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm install
- name: Build app in prod mode
run: npm run build-prod
- name: Run unit tests
run: npm run test-ci
- name: Run e2e tests
run: |
npm run webdriver-update
npm run test-e2e-protractor
update_release_draft:
name: Update next release draft
needs: build-test
runs-on: ubuntu-latest
# Drafts your next Release notes as Pull Requests are merged into "main" branch
if: github.ref == 'refs/heads/main'
steps:
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
# 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:
- name: Checkout source
uses: actions/checkout@v1
with:
fetch-depth: 50
- name: Get previous tag
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@1.0.0"
- name: Update version in package.json
run: npm version ${{steps.previoustag.outputs.tag}} --git-tag-version=false --commit-hooks=false
- name: Update CHANGELOG
uses: lakto/gren-changelog-action@v0.0.1
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
with:
options: '--override'
- name: Attach CHANGELOG to release assets
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GH_TOKEN }}
file: CHANGELOG.md
tag: ${{ github.ref }}
overwrite: true
- name: Build and publish image
run: |
echo ${{ secrets.DOCKER_HUB_TOKEN }} | docker login -u ${{ secrets.DOCKER_USER }} --password-stdin
make publish-dsp-app-image