-
Notifications
You must be signed in to change notification settings - Fork 0
104 lines (102 loc) · 3.17 KB
/
fullstack.yaml
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
name: Fullstack Pipeline
on:
push:
branches:
- main
pull_request:
branches:
- main
types:
- opened
- synchronize
jobs:
backend_workflow:
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: cd backend && yarn install
- name: Lint
run: cd backend && yarn lint
- name: Test
run: cd backend && TEST_MONGODB_URI=${{ secrets.TEST_MONGODB_URI }} SECRET=${{ secrets.SECRET }} yarn test
- name: Test Failure
uses: BubbleProd/discord-webhook-notify@v2
if: failure()
with:
severity: error
details: Pipeline failed
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
frontend_deployment:
runs-on: ubuntu-20.04
needs:
- backend_workflow
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: cd frontend && yarn install
- name: Lint
run: cd frontend && yarn lint
- name: Build
run: cd frontend && yarn build
- name: Test
run: cd frontend && yarn test
- name: Test Failure
uses: BubbleProd/discord-webhook-notify@v2
if: failure()
with:
severity: error
details: Pipeline failed
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
- name: Deploy to production
id: deploy
env:
COMMIT_MESSAGES: ${{ join(github.event.commits.*.message, ' ') }}
if: ${{ github.event_name == 'push' && !contains(env.COMMIT_MESSAGES, '#skip') }}
uses: johnbeynon/[email protected]
with:
service-id: ${{ secrets.RENDER_SERVICE_ID }}
api-key: ${{ secrets.RENDER_API_KEY }}
- name: Test Failure
uses: BubbleProd/discord-webhook-notify@v2
if: failure()
with:
severity: error
details: Pipeline failed
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
- name: Test Failure at Deploy
uses: BubbleProd/discord-webhook-notify@v2
if: ${{ steps.deploy.conclusion == 'failure' }}
with:
severity: error
details: ${{ steps.deploy.outputs.message }}
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
tag_release:
if: ${{ github.event_name == 'push' && !contains(join(github.event.commits.*.message, ' '), '#skip') }}
needs: frontend_deployment
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Bump version and push tag
uses: anothrNick/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DEFAULT_BUMP: patch
WITH_V: true
- name: Test success
uses: BubbleProd/discord-webhook-notify@v2
if: success()
with:
severity: info
details: Pipeline success
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}