-
Notifications
You must be signed in to change notification settings - Fork 1
46 lines (39 loc) · 1.29 KB
/
nix-build.yaml
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
name: nix build
on:
push:
jobs:
nix-build:
name: nix build
runs-on: ubuntu-latest
strategy:
matrix:
target:
- x86_64-linux
- aarch64-linux
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
- name: Install Nix ❄
uses: cachix/install-nix-action@v24
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up the Nix Cache 🔌
uses: cachix/cachix-action@v13
with:
name: hasura-v3-dev
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
- name: Build a binary with Nix
run: nix build --print-build-logs '.#${{ matrix.target }}'
- name: Build a Docker image with Nix
run: nix build --print-build-logs '.#docker-${{ matrix.target }}'
# scream into Slack if something goes wrong
- name: Report Status
if: always() && github.ref == 'refs/heads/main'
uses: ravsamhq/notify-slack-action@v2
with:
status: ${{ job.status }}
notify_when: failure
notification_title: "😧 Error on <{repo_url}|{repo}>"
message_format: "🐴 *{workflow}* {status_message} for <{repo_url}|{repo}>"
env:
SLACK_WEBHOOK_URL: ${{ secrets.BROKEN_BUILD_SLACK_WEBHOOK_URL }}