Repository navigation
80 lines (68 loc) · 2.44 KB
/
Copy pathon-push.yml
File metadata and controls
80 lines (68 loc) · 2.44 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
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
name: On Branch Update
on:
push:
branches:
- main
- "**"
permissions:
contents: read
id-token: write # for QLTY code coverage (https://docs.qlty.sh/migration/coverage)
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version-file: .nvmrc
- name: Install dependencies
run: npm ci
- run: npx prettier --check .
- run: npx eslint . --max-warnings=0
- name: Run unit tests with coverage
run: npm run test:cov
- uses: qltysh/qlty-action/coverage@ebcd284bf32e36a030afe15f1e136c7be08b9506 # v2.5.0
with:
oidc: true
files: coverage/lcov.info
- name: Run e2e tests
run: npm run test:e2e
# Check name: `Create Release / release`. Auto release mode: every releasable push to main becomes a full release.
release:
name: Create Release
if: github.ref == 'refs/heads/main'
needs:
- test
uses: Aam-Digital/.github/.github/workflows/release.yml@v1
permissions:
contents: read # everything that writes uses the GH_TOKEN PAT (its releases trigger the image build)
secrets:
token: ${{ secrets.GH_TOKEN }}
# Edge build of every main push (see Aam-Digital/.github): version `X.Y.Z-edge.N` (the last release with the patch
# number bumped, plus the commits since), no tag and no GitHub release.
edge-version:
if: github.ref == 'refs/heads/main'
needs:
- test
uses: Aam-Digital/.github/.github/workflows/edge-version.yml@v1
permissions:
contents: read
# Check names: `edge-build / build (<platform>)`, `edge-build / merge`. Image `X.Y.Z-edge.N`, plus `edge` if this is still the newest main commit.
# A newer push cancels an older edge build, so that `edge` never moves back.
edge-build:
needs: edge-version
concurrency:
group: edge-build
cancel-in-progress: true
uses: Aam-Digital/.github/.github/workflows/docker-image.yml@v1
permissions:
contents: read
packages: write
with:
images: ghcr.io/aam-digital/platform-admin-services
version: ${{ needs.edge-version.outputs.version }}
tags: ${{ needs.edge-version.outputs.is-head == 'true' && 'edge' || '' }}
# package.json's version is what the app reports to Sentry
prepare: npm version "$VERSION" --no-git-tag-version --allow-same-version