-
Notifications
You must be signed in to change notification settings - Fork 24
51 lines (48 loc) · 1.39 KB
/
actions.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
---
on: [push]
jobs:
tests:
name: Run Tests
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./server-tests
env:
DEBUG: '*'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- working-directory: ./server-nodejs
run: npm ci
- working-directory: ./server-nodejs
run: npm start & #Would be better to directly run tests with mocha + supertest
#instead of running the server in background
- run: npm ci
- run: npm test
services:
mongo:
image: mongo:latest
ports:
- 27017:27017
push_image:
name: Push Docker image
runs-on: ubuntu-latest
if: github.ref_type == 'tag' ||
contains(fromJSON('["master", "testing", "experimental"]'), github.ref_name)
needs: tests
steps:
- uses: actions/checkout@v4
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- id: meta
uses: docker/metadata-action@v5
with:
images: ${{ github.repository }}
- uses: docker/build-push-action@v5
with:
file: docker/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}