~cyplo/blog

blog/.build.yml -rw-r--r-- 1.0 KiB
b32ebf33 — Cyryl Płotnicki print size of file 14 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
image: nixos/latest
sources:
  - https://git.sr.ht/~cyplo/blog

secrets:
  - b7161fff-05f4-4470-b4a1-57bd67dede23
  - 47d167ed-ef43-4515-9923-6954d34a4fab

oauth: pages.sr.ht/PAGES:RW

tasks:
  - fetch_tools: |
      cd blog
      nix-shell --pure --run 'date'
  - github_push: |
      set +xv
      cd blog
      GITHUB_TOKEN=`cat ~/.github_token`
      git remote add github https://cyplo:$GITHUB_TOKEN@github.com/cyplo/blog.git
      nix-shell --pure --run 'git push github --all --force'
  - build: |
      cd blog
      nix-shell --pure --run 'hugo --gc --minify'
  - netlify_publish: |
      set +xv
      cd blog
      export NETLIFY_TOKEN=`cat ~/.netlify_token`
      if [ `git branch --contains HEAD | grep -i master` ]; then nix-shell --pure --keep NETLIFY_TOKEN --run 'netlify-deployer master 7a0944f0-cfd0-424b-8252-ca44fc950350 public'; fi
  - package: |
      tar -C blog/public -cv . > site.tar
      gzip --best site.tar
      ls -hal site.tar.gz
  - sourcehut_upload: |
      acurl -i -f https://pages.sr.ht/publish/cyplo.srht.site -Fcontent=@site.tar.gz