summaryrefslogtreecommitdiffstats
path: root/.build.yml
blob: cf23eea3b440c31d6e166fb568458ba6677d5be8 (plain) (blame)
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
image: archlinux
packages:
  - rsync
  - wget
sources:
  - https://git.sr.ht/~bandali/aminb.org
environment:
  deploy: deploy@aminb.org
  hugo_version: "0.50"
secrets:
  - 6da5fd68-0594-4fc6-abe0-efe01ffe4b56
tasks:
  - setup: |
      wget "https://github.com/gohugoio/hugo/releases/download/v${hugo_version}/hugo_extended_${hugo_version}_Linux-64bit.tar.gz"
      wget "https://github.com/gohugoio/hugo/releases/download/v${hugo_version}/hugo_extended_${hugo_version}_checksums.txt"
      calculated_sha=$(sha256sum "hugo_extended_${hugo_version}_Linux-64bit.tar.gz")
      expected_sha=$(grep "hugo_extended_${hugo_version}_Linux-64bit.tar.gz" "hugo_extended_${hugo_version}_checksums.txt")
      printf "calculated: %s\n  expected: %s" "$calculated_sha" "$expected_sha"
      [ "$calculated_sha" = "$expected_sha" ]
      tar xzf "hugo_extended_${hugo_version}_Linux-64bit.tar.gz"
  - build: |
      cd aminb.org
      ../hugo --minify
  - deploy: |
      cd aminb.org
      sshopts="-o StrictHostKeyChecking=no"
      rsync --rsh="ssh $sshopts" -rP public/ ${deploy}:/var/www/aminb/html/