-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (62 loc) · 2.14 KB
/
nix-deploy.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
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
name: Postgres NDC build and push binaries with Nix
on:
push:
branches:
- main
tags:
- "v*"
jobs:
build_and_deploy:
name: build and deploy
runs-on: ubuntu-latest
strategy:
matrix:
connectors:
[
{
"build_command": "ndc-postgres-x86_64-linux",
"binary_artifact_name": "hasura-postgres-agent-rs",
"artifact_path": "result/bin/ndc-postgres",
},
{
"build_command": "ndc-cockroach-x86_64-linux",
"binary_artifact_name": "hasura-cockroach-agent-rs",
"artifact_path": "result/bin/ndc-cockroach",
},
{
"build_command": "ndc-citus-x86_64-linux",
"binary_artifact_name": "hasura-citus-agent-rs",
"artifact_path": "result/bin/ndc-citus",
},
]
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
- name: Install Nix ❄
uses: DeterminateSystems/nix-installer-action@v4
- name: Run the Magic Nix Cache 🔌
uses: DeterminateSystems/magic-nix-cache-action@v2
- name: Login to GitHub Container Registry 📦
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: build the crate using nix 🔨
run: nix build .#${{ matrix.connectors.build_command}} --print-build-logs
- name: Create release 🚀
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.connectors.binary_artifact_name }}
path: ${{ matrix.connectors.artifact_path }}
# scream into Slack if something goes wrong
- name: Report Status
if: always()
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 }}