-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (35 loc) · 922 Bytes
/
main.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
name: CI
on:
push:
release:
types: [published]
jobs:
# run build in prod mode
build-test:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Install dependencies
run: npm install
- name: Build app in prod mode
run: npm run build-prod
# publish only on release
publish:
name: Publish to Dockerhub
needs: build-test
runs-on: ubuntu-latest
if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags')
steps:
- name: checkout source
uses: actions/checkout@v1
with:
fetch-depth: 50
- name: build and publish image
run: |
echo ${{ secrets.DOCKER_HUB_TOKEN }} | docker login -u ${{ secrets.DOCKER_USER }} --password-stdin
make publish-app-image