~aasg/haunted-blog

ref: fef67bdcac88c14b6ac6affe93e290c1a4fb6ee2 haunted-blog/.build.yml -rw-r--r-- 1.3 KiB
fef67bdc — Aluísio Augusto Silva Gonçalves Render post tags and relayout post lists 1 year, 17 days 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
35
36
37
38
39
40
image: nixos/latest
sources:
  - https://git.sr.ht/~aasg/haunted-blog
environment:
  job_name: haunted-blog
  cluster_address: /dnsaddr/c.ipfs.aasg.name
secrets:
  - cb717add-b052-4389-ba30-1fafaf9c79c7
tasks:
  - prepare: |
      mkdir -p ~/.config/nix
      cat >~/.config/nix/nix.conf <<EOF
        substituters = https://cache.nixos.org https://aasg-nixexprs.cachix.org
        trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= aasg-nixexprs.cachix.org-1:Oj2bsYzB3GBBF3Q0DT3ELAF6UBrPJkBYYGmoFBWmK1M=
      EOF
      nix-env --file haunted-blog --install --attr ciDeps
  - build: |
      nix-build haunted-blog
  - package: |
      result=$(realpath result)
      bsdtar -caf ~/site.tar.zst --format=rpax --strip-components=3 "$result"
  - publish: |
      set -o pipefail
      shopt -s lastpipe
      export CLUSTER_CREDENTIALS

      result=$(realpath result)
      read -r CLUSTER_CREDENTIALS <~/.ipfs-cluster.key
      ipfs-cluster-ctl --host "$cluster_address" \
        add --quieter --recursive --name "$job_name-$JOB_ID" "$result" \
      | tee ~/cid | ipfs cid base32 | read -r cid

      echo "Published to https://$cid.ipfs.dweb.link"
artifacts:
  - site.tar.zst
  - cid
triggers:
  - action: webhook
    condition: success
    url: https://aasg.name/update/aasg.name