-
Notifications
You must be signed in to change notification settings - Fork 64
42 lines (34 loc) · 1.13 KB
/
master.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
# run build on master brunch. build docker image and push to docker hub
name: master
on:
workflow_dispatch:
push:
branches:
- master
tags:
- '*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18'
- name: install dependencies
run: npm i
- name: dependency check
run: npm run dependencyCheck
- name: run all tests
run: npm test
- name: build app & docker image
run: npm run build:dockerImage
# push docker image to repo (the --all-tags flag was introduced in version v20.10, older versions pushed all images automatically if no tag was provided)
- name: push docker image
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: |
docker -v;
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin;
docker image push --all-tags "${DOCKER_USERNAME}/poinz" || docker image push "${DOCKER_USERNAME}/poinz";