-
Notifications
You must be signed in to change notification settings - Fork 79
51 lines (42 loc) · 1.2 KB
/
master.yml
File metadata and controls
51 lines (42 loc) · 1.2 KB
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
# 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
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '22'
- name: install dependencies
run: npm i
- name: dependency check
run: npm run dependencyCheck
- name: run all tests
run: npm test
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: build app & docker image
env:
DOCKER_REGISTRY: ghcr.io
DOCKER_USERNAME: ${{ github.repository_owner }}
run: npm run build:dockerImage
- name: Push Docker image
env:
DOCKER_USERNAME: ${{ github.repository_owner }}
run: |
docker image push --all-tags "ghcr.io/${DOCKER_USERNAME,,}/poinz" || docker image push "ghcr.io/${DOCKER_USERNAME,,}/poinz"