35 lines
1 KiB
YAML
35 lines
1 KiB
YAML
|
image: nixos/latest
|
||
|
sources:
|
||
|
- https://git.sr.ht/~cyplo/blog
|
||
|
|
||
|
secrets:
|
||
|
- 6c23a8c1-7a30-4a7e-b3b7-0171e898a7d3
|
||
|
- 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
|