generated from EntraptaJ/Application-Template
-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (60 loc) · 1.7 KB
/
API.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
name: API
on:
push:
pull_request:
jobs:
Test:
name: Testing
runs-on: ubuntu-latest
services:
postgres:
image: postgres:11-alpine
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: pgpass
POSTGRES_HOST: localhost
POSTGRES_DB: application-test
ports:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v1
- uses: KristianFJones/npm-run-action@alternative
env:
DB_HOST: postgres
with:
scriptName: 'test'
scriptPath: 'API/'
Prettier:
name: Prettier
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: KristianFJones/npm-run-action@alternative
with:
scriptName: 'prettier'
scriptPath: 'API/'
Lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: KristianFJones/npm-run-action@alternative
with:
scriptName: 'lint'
scriptPath: 'API/'
Build:
runs-on: ubuntu-latest
needs: [Test, Prettier, Lint]
steps:
- uses: actions/checkout@master
- name: Publish to Registry
uses: KristianFJones/Publish-Docker-Github-Action@master
with:
dockerfile: API/Dockerfile
name: docker.pkg.github.com/kristianfjones/distributed-dns/distributed-dns-api
username: ${{ secrets.DOCKER_GITHUB_USERNAME }}
password: ${{ secrets.DOCKER_GITHUB_PASSWORD }}
registry: docker.pkg.github.com
path: API