-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (51 loc) · 1.66 KB
/
develop.yml
File metadata and controls
63 lines (51 loc) · 1.66 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
on:
pull_request:
branches:
- develop
types: [closed]
push:
branches:
- develop
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
with:
persist-credentials: false
- name: install node
uses: actions/setup-node@v2
with:
node-version: 16.x
- name: installation
run: npm ci
- name: lint
run: npm run lint
- name: test
run: npm run test
- name: audit (only failing for >= HIGH severity, or exit code 8+)
run: /bin/bash -c 'npm audit --only=prod --audit-level=high; [[ $? -ge 8 ]] && exit $? || exit 0'
deploy:
if: github.event.pull_request.merged == true
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2 # checkout repo
- uses: 'google-github-actions/auth@v0'
with:
credentials_json: ${{ secrets.GKE_SA_KEY }} #
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v0'
# Configure credentials for docker
- run: gcloud auth configure-docker
# Build the Docker image
- run: docker build -t ${{ secrets.GKE_CLUSTER_IMAGE_TST }} .
# Push the Docker image to Google Container Registry
- run: docker push ${{ secrets.GKE_CLUSTER_IMAGE_TST }}
- run: gcloud container clusters get-credentials ${{ secrets.GKE_CLUSTER_NAME_TST }} --zone ${{ secrets.GKE_ZONE }} --project ${{ secrets.PROJECT_ID }}
# Install helm
- uses: azure/setup-helm@v1
id: install
# Deploy latest version
- run: kubectl rollout restart deployment/api -n tst