forked from Vakaris-U/ignition-git-module
-
Notifications
You must be signed in to change notification settings - Fork 1
83 lines (70 loc) · 2.01 KB
/
ci-ignition-git-module.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: continuous integration - core-mes
concurrency:
group: core-mes
cancel-in-progress: true
on:
pull_request:
branches:
- main
push:
branches:
- main
# paths: ["./apps/core-mes"]
# workflow_dispatch: # uncomment me to have it manually trigger the gh action
env:
REGISTRY: ghcr.io
jobs:
continuous-integration:
name: continuous integration
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
issues: write
pull-requests: write
steps:
- name: checkout
uses: actions/checkout@v3
- name: setup node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: install dependencies
run: npm install
working-directory: ./apps/core-mes
- name: build
run: npm run build
working-directory: ./apps/core-mes
- name: test
run: npm run test-coverage
working-directory: ./apps/core-mes
- name: Run tests
run: |
npx jest --coverage | tee ./coverage.txt && exit ${PIPESTATUS[0]}
working-directory: ./apps/core-mes
- name: docker metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/WHK01/whk-mes/core-mes
flavor: latest=true
tags: |
type=sha,prefix=sha-
type=ref,event=branch
type=ref,event=pr,prefix=pr-
type=ref,event=tag,prefix=tag-
type=raw,value=${{ github.run_id }},prefix=gh-
- name: login to image repostiory
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: build and push
uses: docker/build-push-action@v3
with:
context: ./apps/core-mes
file: ./apps/core-mes/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}