~aasg/haunted-blog

f2684833f0f9d0bad6ef06fb287975aeceb2124a — Aluísio Augusto Silva Gonçalves 1 year, 1 month ago a4864d2
ci: Output IPFS link to build log

A simple change, wouldn't you say?
1 files changed, 9 insertions(+), 3 deletions(-)

M .build.yml
M .build.yml => .build.yml +9 -3
@@ 3,6 3,7 @@ repositories:
  nixpkgs: https://nixos.org/channels/nixpkgs-unstable
packages:
  - nixpkgs.cachix
  - nixpkgs.ipfs
  - nixpkgs.ipfs-cluster
  - nixpkgs.libarchive
sources:


@@ 21,14 22,19 @@ tasks:
  - package: |
      result=$(realpath result)
      # TODO: switch to zstd (needs NixOS/nixpkgs#85957)
      bsdtar -caf site.tar.xz --format=rpax --strip-components=3 "$result"
      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
      export CLUSTER_CREDENTIALS
      ipfs-cluster-ctl --host "$cluster_address" \
        add --quieter --recursive --name "$job_name-$JOB_ID" "$result" \
        >cid
      | tee ~/cid | ipfs cid base32 | read -r cid

      echo "Published to https://$cid.ipfs.dweb.link"
artifacts:
  - site.tar.xz
  - cid