This repository was archived by the owner on Nov 7, 2026. It is now read-only.
Repository navigation
124 lines (124 loc) · 3.72 KB
/
Copy pathdeploy.yml
File metadata and controls
124 lines (124 loc) · 3.72 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
name: Deploy
on:
push:
branches: ['*'] # Do not run on tags
jobs:
lint:
name: List with eslint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup Node 10
uses: actions/setup-node@v1
with:
node-version: '10.x'
- name: Setup cache
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm install
- name: Lint with eslint
run: npm run lint
test:
name: Test with jest
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup Node 10
uses: actions/setup-node@v1
with:
node-version: '10.x'
- name: Setup cache
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm install
- name: Run jest
run: npm run test:ci
- name: Upload coverage reports
uses: actions/upload-artifact@v1.0.0
with:
name: coverage
path: coverage
# analyse:
# name: Analyse with SonarQube
# needs: [test]
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v1
# - name: Download coverage reports
# uses: actions/download-artifact@v1.0.0
# with:
# name: coverage
# path: coverage
# - name: Setup sonar.properties
# run: |
# # Setup version
# VERSION=$(jq -r .version package.json)
# echo "sonar.projectVersion=${VERSION}" >> sonar-project.properties
# - name: Analyse with Sonar Scanner
# uses: mathrix-education/sonar-scanner@master
# with:
# version: 4.2.0.1873
# scan: true
# typescript: true
# args: -Dsonar.host.url=${{ secrets.SONAR_HOST }} -Dsonar.login=${{ secrets.SONAR_TOKEN }}
build:
name: Build with Typescript
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup Node 10
uses: actions/setup-node@v1
with:
node-version: '10.x'
- name: Setup cache
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm install
- name: Compile with TypeScript compiler
run: npm run build && cp package.json dist/package.json
- name: Upload build artifact
uses: actions/upload-artifact@v1.0.0
with:
name: build
path: dist
# deploy:
# name: Deploy on Google Cloud Functions
# needs: [test, analyse, build]
# runs-on: ubuntu-latest
# steps:
# - name: Download build artifact
# uses: actions/download-artifact@v1.0.0
# with:
# name: build
# path: .
# - name: Setup Google Cloud SDK
# uses: mathrix-education/setup-gcloud@0.1.2
# with:
# project: ${{ secrets.GCLOUD_PROJECT }}
# service-account-key: ${{ secrets.GCLOUD_AUTH }}
# - name: Deploy the Cloud Function
# run: |
# gcloud functions deploy your-function \
# --region=europe-west1 \
# --runtime=nodejs10 \
# --trigger-topic=your-pubsub-topic \
# --set-env-vars=SENTRY_DSN=${{ secrets.SENTRY_DSN }},RELEASE=${GITHUB_SHA:0:7}