blog/.build.yml

30 lines
712 B
YAML
Raw Normal View History

2022-06-25 08:47:06 +01:00
image: nixos/latest
sources:
- https://git.sr.ht/~cyplo/blog
2022-08-21 12:02:43 +01:00
oauth: pages.sr.ht/PAGES:RW
2022-06-25 08:47:06 +01:00
secrets:
- 6c23a8c1-7a30-4a7e-b3b7-0171e898a7d3
2022-08-21 12:02:43 +01:00
environment:
site: blog.cyplo.dev
2022-06-25 08:47:06 +01:00
tasks:
- fetch_tools: |
cd blog
nix-shell --pure --run 'date'
- build: |
cd blog
nix-shell --pure --run 'hugo --gc --minify'
- package: |
2022-08-21 12:03:32 +01:00
tar -C blog/public -cvz . > site.tar.gz
2022-08-21 12:02:43 +01:00
- upload: |
2022-08-21 12:23:07 +01:00
acurl -f https://pages.sr.ht/publish/$site -Fcontent=@site.tar.gz
- 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'