-
Notifications
You must be signed in to change notification settings - Fork 4
56 lines (56 loc) · 1.69 KB
/
ci.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
on:
pull_request:
push:
branches: [main, beta]
jobs:
format:
runs-on: ubuntu-latest
permissions:
contents: write
outputs:
git-head: ${{ steps.git-push.outputs.head-sha }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
- uses: DeterminateSystems/nix-installer-action@v14
- uses: DeterminateSystems/magic-nix-cache-action@v8
- run: nix fmt
- uses: cihelper/action-git-push@v1
id: git-push
with:
commit-message: "chore: reformat code"
check:
runs-on: ubuntu-latest
needs: format
permissions:
contents: read
steps:
- uses: actions/checkout@v4
with:
ref: ${{ needs.format.outputs.git-head }}
- uses: DeterminateSystems/nix-installer-action@v14
- uses: DeterminateSystems/magic-nix-cache-action@v8
- run: nix flake check --show-trace
release:
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'recap-utr' && github.event_name == 'push' }}
needs:
- check
- format
permissions:
contents: write
packages: write
steps:
- uses: actions/checkout@v4
with:
ref: ${{ needs.format.outputs.git-head }}
- uses: DeterminateSystems/nix-installer-action@v14
- uses: DeterminateSystems/magic-nix-cache-action@v8
- uses: cihelper/action-semanticrelease-npm@v1
id: semanticrelease
- run: nix run .#dockerManifest --impure
if: ${{ steps.semanticrelease.outputs.released == 'true' }}
env:
VERSION: ${{ steps.semanticrelease.outputs.version }}
GH_TOKEN: ${{ github.token }}