-
Notifications
You must be signed in to change notification settings - Fork 10
89 lines (78 loc) · 2.94 KB
/
build.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: "Build and populate cache"
on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: "0 */6 * * *"
workflow_dispatch:
jobs:
build:
name: Build
strategy:
fail-fast: false
matrix:
cachixName:
- ezkea
nixpkgs:
- nixos-unstable
# - nixpkgs-unstable
- nixos-23.11
- pinned
runs-on: ubuntu-latest
steps:
- name: Install Doppler CLI
uses: dopplerhq/cli-action@v3
- name: Pass all secrets to next steps
run: |
while read -rd $'' line; do echo "$line" >> $GITHUB_ENV; done < <( doppler secrets download --no-file --format=json | jq "." | grep -v 'DOPPLER_\(CONFIG\|ENVIRONMENT\|PROJECT\)' | jq -r 'to_entries|map("\(.key)<<EOF\n\(.value)\nEOF\u0000")[]' )
while read -r line; do echo "::add-mask::$line"; done < <( doppler secrets download --no-file --format=json | jq "." | grep -v 'DOPPLER_\(CONFIG\|ENVIRONMENT\|PROJECT\)' | jq -r 'to_entries|map("\(.value)\u0000")[]' )
env:
DOPPLER_TOKEN: ${{ secrets.DOPPLER_TOKEN }}
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Nix
uses: cachix/install-nix-action@v25
- name: Install Cachix
uses: cachix/cachix-action@v14
with:
name: ${{ matrix.cachixName }}
authToken: '${{ env.CACHIX_AUTH_TOKEN }}'
pushFilter: '(-source$|-src$|\.tar\.gz$|\.patch$)'
- name: Build
run: |
if [[ ${{ matrix.nixpkgs }} == "pinned" ]]; then
nix build --accept-flake-config -L .#allLaunchers
else
nix build \
--accept-flake-config \
--print-build-logs \
--override-input nixpkgs "github:NixOS/nixpkgs/${{ matrix.nixpkgs }}" \
.#allLaunchers
fi
telegram:
name: Telegram
needs: build
runs-on: ubuntu-latest
if: always()
steps:
- name: Install Doppler CLI
uses: dopplerhq/cli-action@v3
- name: Pass all secrets to next steps
run: |
while read -rd $'' line; do echo "$line" >> $GITHUB_ENV; done < <( doppler secrets download --no-file --format=json | jq "." | grep -v 'DOPPLER_\(CONFIG\|ENVIRONMENT\|PROJECT\)' | jq -r 'to_entries|map("\(.key)<<EOF\n\(.value)\nEOF\u0000")[]' )
while read -r line; do echo "::add-mask::$line"; done < <( doppler secrets download --no-file --format=json | jq "." | grep -v 'DOPPLER_\(CONFIG\|ENVIRONMENT\|PROJECT\)' | jq -r 'to_entries|map("\(.value)\u0000")[]' )
env:
DOPPLER_TOKEN: ${{ secrets.DOPPLER_TOKEN }}
- name: Get workflow conclusion
uses: technote-space/workflow-conclusion-action@v3.0
- name: Send notification
uses: yanzay/notify-telegram@v0.1.0
with:
chat: ${{ env.NOTIFICATION_CHAT_ID }}
token: ${{ env.NOTIFICATION_TOKEN }}
status: ${{ env.WORKFLOW_CONCLUSION }}
if: env.WORKFLOW_CONCLUSION != 'success'