From d1419a2665e70c30cf8f35d38b987b3762e4814a Mon Sep 17 00:00:00 2001 From: Ahmed Abdelhalim Date: Sun, 5 Jun 2022 16:51:53 +0200 Subject: Publish only main branch --- .build.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to '.build.yml') diff --git a/.build.yml b/.build.yml index fe7eb23..7c410e8 100644 --- a/.build.yml +++ b/.build.yml @@ -13,5 +13,13 @@ tasks: tar -C public -cvz . > ../site.tar.gz - publish: | - acurl -f https://pages.sr.ht/publish/a14m.me -Fcontent=@site.tar.gz - acurl -f https://pages.sr.ht/publish/a14m.srht.site -Fcontent=@site.tar.gz + set +x + cd a14m.srht.site + REF=`git describe --exact-match --all ||:` + echo "Current Ref: $REF" + if [[ ! `echo $REF | awk '/origin\/main$/'` ]]; then + echo "Skipping publishing step. only publishing 'main' branch" + exit 0 + fi + acurl -f https://pages.sr.ht/publish/a14m.me -Fcontent=@../site.tar.gz + acurl -f https://pages.sr.ht/publish/a14m.srht.site -Fcontent=@../site.tar.gz -- cgit v1.2.3