-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (49 loc) · 1.48 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
name: build
concurrency: build-${{ github.ref }}
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_run:
types: [completed]
workflows:
- update flakes
- update testing broker
- update testing demo
jobs:
build:
if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Deploy on success
if: github.repository == 'portier/public-infra' && github.ref == 'refs/heads/main'
uses: ./.github/actions/deploy-on-success
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Prepare Nix auth
run: |
sudo mkdir -p /etc/systemd/system/nix-daemon.service.d
sudo tee -a /etc/systemd/system/nix-daemon.service.d/auth.conf > /dev/null << EOF
[Service]
Environment="GITHUB_TOKEN=$GITHUB_TOKEN"
EOF
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install Nix
uses: cachix/install-nix-action@V27
- name: Cachix
uses: cachix/cachix-action@v15
with:
name: portier
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: Build
run: nix build -vL
- name: Check result
run: |
DEPLOY_STORE_PATH="$(readlink result)"
echo "Result: $DEPLOY_STORE_PATH"
# Used by deploy-on-success post step.
echo "DEPLOY_STORE_PATH=$DEPLOY_STORE_PATH" >> $GITHUB_ENV