-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (70 loc) · 2.22 KB
/
production.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
name: Build production-image
on:
release:
types: [published]
jobs:
test:
name: "Run linter and Cypress tests"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: npm ci
run: npm ci
- name: npm run lint
run: npm run lint
- uses: 1arp/[email protected]
with:
path: 'client'
file: 'outsideGitFakeUsers.json'
content: |
[]
- name: docker compose up -d
run: E2E=true docker compose -f docker-compose-test.yml up -d
- name: Run cypress tests
run: ./node_modules/.bin/cypress run --headless *.spec.js
build:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build image
id: build-image
uses: redhat-actions/buildah-build@v2
with:
image: fuksilaiterekisteri
tags: production ${{ github.sha }}
containerfiles: |
./Dockerfile
build-args: |
BASE_PATH=/fuksilaite/
GIT_SHA=${{ github.sha }}
NODE_ENV=production
SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}
- 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 }}
notify:
runs-on: ubuntu-latest
needs: [test, build]
if: always()
steps:
- name: Notify failed
uses: UniversityOfHelsinkiCS/[email protected]
if: (needs.test.result != 'success' || needs.build.result != 'success')
with:
webhook-url: ${{ secrets.WEBHOOK_URL }}
message-type: test-failure
- name: Notify success
uses: UniversityOfHelsinkiCS/[email protected]
if: (needs.test.result == 'success' || needs.build.result == 'success')
with:
webhook-url: ${{ secrets.WEBHOOK_URL }}
message-type: deployment
deployment-target: production
softa-url: https://study.cs.helsinki.fi/fuksilaite/