~remexre/stahl

ref: 73f725affe67dc610d8bca8945f8575a04fefc48 stahl/.build.yml -rw-r--r-- 1.5 KiB
73f725afNathan Ringo Track build time. 3 months ago
                                                                                
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
image: nixos/unstable
sources:
- https://git.sr.ht/~remexre/stahl
secrets:
- 598e1091-3b25-4729-8434-e970124384f4
- 68fa6f30-ba68-4b97-86fc-89c612904d13
- 7ce8eb0b-f794-4333-862c-af6136d9b32c
tasks:
- update-nix: nix-env -iA nixos.nixUnstable
- cachix-install: |
    nix-env -iA cachix -f https://cachix.org/api/v1/install
    cachix authtoken --stdin < ~/.cachix-auth-token
    cachix use stahl
- pre-build: nix --experimental-features nix-command path-info --all > /tmp/store-paths-pre-build
- build: time nix --experimental-features "flakes nix-command" --print-build-logs build ./stahl
- post-build: nix --experimental-features nix-command path-info --all > /tmp/store-paths-post-build
- cachix-upload: comm -13 <(grep -v '\.drv$' /tmp/store-paths-pre-build | sort) <(grep -v '\.drv$' /tmp/store-paths-post-build | sort) | cachix push stahl
- deploy: |
    echo "StrictHostKeyChecking=no" >> ~/.ssh/config
    rsync -a --delete result/doc.stahlos.com/ deploy@cdn.remexre.xyz:/www/doc.stahlos.com/
    rsync -a --delete result/stahlos.com/ deploy@cdn.remexre.xyz:/www/stahlos.com/
- purge_cache: |
    set +x
    source ~/.cloudflare_secrets
    curl "https://api.cloudflare.com/client/v4/zones/$CLOUDFLARE_IDENTIFIER/purge_cache" \
        -H "Authorization: Bearer $CLOUDFLARE_TOKEN" \
        -H "Content-Type: application/json" \
        -X POST \
        --data '{"purge_everything":true}'
    set -x
triggers:
- action: email
  condition: failure
  to: Nathan Ringo <nathan+stahl-builds@remexre.xyz>