~aasg/haunted-blog

ref: 3879a21d2b94755cd14850824e1cd16e9591fff7 haunted-blog/.build.yml -rw-r--r-- 1.1 KiB
3879a21d — Aluísio Augusto Silva Gonçalves css: Sort out the site's color scheme 1 year, 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
35
36
37
38
39
40
image: nixos/latest
repositories:
  nixpkgs: https://nixos.org/channels/nixpkgs-unstable
packages:
  - nixpkgs.cachix
  - nixpkgs.ipfs
  - nixpkgs.ipfs-cluster
  - nixpkgs.libarchive
sources:
  - git@git.sr.ht:~aasg/haunted-blog
environment:
  job_name: haunted-blog
  cluster_address: /dnsaddr/c.ipfs.aasg.name
secrets:
  - f1446527-e55e-44f8-bbd0-ed53f58af988
  - 03609804-4785-44cd-8367-4d229fcb9c9d
tasks:
  - prepare: |
      cachix use aasg-nixexprs
  - build: |
      nix-build haunted-blog
  - package: |
      result=$(realpath result)
      # TODO: switch to zstd (needs NixOS/nixpkgs#85957)
      bsdtar -caf ~/site.tar.xz --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.xz
  - cid