-
Notifications
You must be signed in to change notification settings - Fork 0
117 lines (108 loc) · 3.18 KB
/
node-push.js.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
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
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Node.js CI on push
on:
push:
branches: [ master ]
jobs:
frontend:
runs-on: ubuntu-latest
defaults:
run:
working-directory: frontend
strategy:
matrix:
node-version: [22]
mongodb-version: [4.4.0]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm ci && cd ../backend && npm ci && cd ../frontend && npm run library
- run: npm run build --if-present
- name: Start MongoDB
uses: supercharge/[email protected]
with:
mongodb-version: ${{ matrix.mongodb-version }}
- run: cd ../backend && nohup npm run start:testServer &
env:
SECRET: ${{ secrets.SECRET }}
PORT: 3001
IMAGEURL: 'images'
- name: Cypress run
uses: cypress-io/github-action@v5
with:
browser: chrome
working-directory: frontend
start: npm start
wait-on: http://localhost:3000
wait-on-timeout: 300
spec: cypress/e2e/*
backend:
runs-on: ubuntu-latest
defaults:
run:
working-directory: backend
strategy:
matrix:
node-version: [22]
mongodb-version: [4.4.0]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Start MongoDB
uses: supercharge/[email protected]
with:
mongodb-version: ${{ matrix.mongodb-version }}
- run: npm ci
- run: npm run library
- run: npm run test-gh-bacterium
env:
SECRET: ${{ secrets.SECRET }}
IMAGEURL: 'images'
- run: npm run test-gh-test
env:
SECRET: ${{ secrets.SECRET }}
IMAGEURL: 'images'
- run: npm run test-gh-user
env:
SECRET: ${{ secrets.SECRET }}
IMAGEURL: 'images'
- run: npm run test-gh-credit
env:
SECRET: ${{ secrets.SECRET }}
IMAGEURL: 'images'
- run: npm run test-gh-game
env:
SECRET: ${{ secrets.SECRET }}
IMAGEURL: 'images'
- run: npm run test-gh-case
env:
SECRET: ${{ secrets.SECRET }}
IMAGEURL: 'images'
- run: npm run test-gh-game-testing
env:
SECRET: ${{ secrets.SECRET }}
IMAGEURL: 'images'
build:
name: 'Publish to dockerhub'
needs: [frontend, backend]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
push: true
tags: hybakteeripeli/app:latest