-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (55 loc) · 1.75 KB
/
test-and-dockerize.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
name: Test and Dockerize
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/[email protected]
with:
node-version: 16.11.1
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Start MongoDB
uses: supercharge/[email protected]
with:
mongodb-version: "5.0.7"
- name: Start Redis
uses: supercharge/[email protected]
with:
redis-version: latest
- name: Run tests
run: npm run test:detectOpen
env:
NODE_ENV: development
MONGO_URI: mongodb://localhost:27017/programming-project
MONGO_PASSWORD:
API_VERSION: 0.0.1
PORT: 8371
dockerize:
needs: test
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v3
with:
push: true
tags: mirzabicer/programming-project:latest