-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (42 loc) · 1.18 KB
/
test-and-push.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
name: test-and-push,
on:
push:
branches:
- main
pull_request:
branches:
- '*'
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
jobs:
test-and-push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22.x
- name: Install dependencies
run: npm ci
- name: Login to GHCR (GitHub Packages)
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build docker image
run: ./docker/build
- name: Push SHA docker image
run: ./docker/push
- name: Run app in docker
run: ./docker/run
- name: Run unit and integration tests with coverage
run: npm run coverage
- name: Upload coverage
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true # optional (default = false)
files: ./coverage/coverage-final.json
token: ${{ secrets.CODECOV_TOKEN }} # required
- name: Push branch docker tag
run: ./docker/push_branch_tag