forked from remyla/damas-core
-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (45 loc) · 1.35 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
on: [push]
jobs:
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: cp conf_template.json conf.json
- working-directory: ./server-nodejs
run: npm ci
- working-directory: ./server-nodejs
run: npm start & #Would be better to directory run tests with mocha + supertest
#instead of running the server in background
- run: npm ci
- run: npm test
services:
mongo:
image: mvertes/alpine-mongo:latest
ports:
- 27017:27017
push_image:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
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 }}