-
Notifications
You must be signed in to change notification settings - Fork 14
111 lines (90 loc) · 2.64 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
name: Test, build and publish
on:
push:
branches:
- '**'
pull_request:
branches:
- '**'
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
test-frontend:
runs-on: ubuntu-18.04
timeout-minutes: 30
env:
MONGODB_VERSION: 3.6.9
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '14'
cache: 'yarn'
- run: yarn install --frozen-lockfile --cache-folder .yarncache
- run: yarn --cwd frontend run lint
- run: yarn --cwd frontend run frontend-test
env:
CI: true
test-backend:
runs-on: ubuntu-18.04
timeout-minutes: 30
env:
MONGODB_VERSION: 4.4.6
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '14'
cache: 'yarn'
- run: yarn install --frozen-lockfile --cache-folder .yarncache
- run: yarn --cwd backend run lint
- run: yarn --cwd backend run backend-test
env:
CI: true
setup-build-publish:
needs: [ test-frontend, test-backend ]
name: Setup, Build, Publish
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
steps:
- name: Checkout
uses: actions/checkout@v3
with:
# token: ${{ secrets.REPO_PERSONAL_TOKEN }}
fetch-depth: 0
# Update Changelog
- name: Update Changelog
run: npm_config_yes=true npx auto-changelog
- name: Log in to the Container registry
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@57396166ad8aefe6098280995947635806a0e6ea
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=sha
# type=schedule
# type=semver,pattern={{version}}
# type=semver,pattern={{major}}.{{minor}}
# type=semver,pattern={{major}}
- name: Build and push Docker image
uses: docker/build-push-action@c56af957549030174b10d6867f20e78cfd7debc5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}