-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (79 loc) · 2.14 KB
/
staging.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
name: Build, test and release staging
on:
push:
branches:
- trunk
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 14.17
- name: Install eslint
run: npm install eslint
- name: Run lint
run: npm run lint
build-and-test:
runs-on: ubuntu-20.04
needs: lint
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Test
run: npm run test
publish:
runs-on: ubuntu-latest
needs: [lint, build-and-test]
steps:
- uses: actions/checkout@v3
- name: Build image
id: build-image
uses: redhat-actions/buildah-build@v2
with:
image: suoritustarkistin
tags: staging ${{ github.sha }}
containerfiles: |
./Dockerfile
build-args: |
BASE_PATH=/suotar/
NODE_ENV=staging
- name: Push to quay.io
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build-image.outputs.image }}
tags: ${{ steps.build-image.outputs.tags }}
registry: quay.io/toska
username: toska+github
password: ${{ secrets.QUAY_IO_TOKEN }}
report_success:
name: 'Report deployment success to Suotar-channel'
runs-on: ubuntu-latest
needs:
- lint
- build-and-test
- publish
if: success()
steps:
- name: 'Send notification to Slack'
uses: UniversityOfHelsinkiCS/[email protected]
with:
webhook-url: ${{ secrets.SLACKBOT_URL }}
message-type: deployment
softa-url: https://toska-staging.cs.helsinki.fi/suotar
deployment-target: staging
report_failure:
name: 'Report test failure to Suotar-channel'
runs-on: ubuntu-latest
needs:
- lint
- build-and-test
- publish
if: failure()
steps:
- name: 'Send notification to Slack'
uses: UniversityOfHelsinkiCS/[email protected]
with:
webhook-url: ${{ secrets.SLACKBOT_URL }}
message-type: test-failure