From ca265b46cc9d2c6f4593970a4cdab14a5fa6cff2 Mon Sep 17 00:00:00 2001 From: Jan Baudisch Date: Thu, 11 Jun 2020 16:25:12 +0200 Subject: [PATCH] move to sourcehut --- .build.yml | 20 ++++++++++++++++++++ .travis.yml | 36 ------------------------------------ README.md | 4 ++-- deploy-url.sh | 15 +++++++++++++++ static/CNAME | 1 - 5 files changed, 37 insertions(+), 39 deletions(-) create mode 100644 .build.yml delete mode 100644 .travis.yml create mode 100755 deploy-url.sh delete mode 100644 static/CNAME diff --git a/.build.yml b/.build.yml new file mode 100644 index 0000000..f113301 --- /dev/null +++ b/.build.yml @@ -0,0 +1,20 @@ +image: archlinux +packages: + - curl + - rsync +sources: + - https://git.sr.ht/~janbaudisch/ghana.janbaudisch.de +secrets: + - d2be8e67-9e75-4024-8229-0afcffd1a161 +tasks: + - setup: | + curl -s https://paste.sr.ht/blob/e03c1b942c5ea3671b83b01766dd374898e306e6 | sh + - build: | + cd ghana.janbaudisch.de + export URL=$(./deploy_url.sh) + sed -i "s/ghana.janbaudisch.de/${URL}/g" config.toml + hugo + - deploy: | + cd ghana.janbaudisch.de + export URL=$(./deploy_url.sh) + ~/rsync public/ $URL diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index b0c1340..0000000 --- a/.travis.yml +++ /dev/null @@ -1,36 +0,0 @@ -language: generic - -install: - - bash <(curl https://gist.githubusercontent.com/janbaudisch/2268d649532153695eabb0c08f210da3/raw/229a792635894f53bba6d1d8a4de025a2d428a36/download-hugo.sh) - - sudo dpkg -i hugo*.deb - -script: - - if [ $TRAVIS_BRANCH == review ]; then sed -i "s/ghana.janbaudisch.de/review.ghana.janbaudisch.de/g" config.toml; fi - - hugo - - if [ $TRAVIS_BRANCH == review ]; then echo "review.ghana.janbaudisch.de" > public/CNAME; fi - -deploy: - - provider: pages - target-branch: gh-pages - local-dir: public - skip-cleanup: true - github-token: $GITHUB_TOKEN - name: flyingB0tat0 - email: bot@baudisch.xyz - keep-history: false - allow-empty-commit: true - on: - branch: master - - - provider: pages - repo: janbaudisch/ghana-review - target-branch: gh-pages - local-dir: public - skip-cleanup: true - github-token: $GITHUB_TOKEN - name: flyingB0tat0 - email: bot@baudisch.xyz - keep-history: false - allow-empty-commit: true - on: - branch: review diff --git a/README.md b/README.md index af04dee..31289f6 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ hugo The generated site will be under `public`. -[build-img]: https://travis-ci.com/janbaudisch/ghana.svg?branch=master -[build-url]: https://travis-ci.com/janbaudisch/ghana +[build-img]: https://builds.sr.ht/~janbaudisch/ghana.janbaudisch.de.svg +[build-url]: https://builds.sr.ht/~janbaudisch/ghana.janbaudisch.de [site]: https://ghana.janbaudisch.de [hugo]: https://gohugo.io diff --git a/deploy-url.sh b/deploy-url.sh new file mode 100755 index 0000000..c9fb359 --- /dev/null +++ b/deploy-url.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +COMMIT=$(git branch | sed -n -e "s/^\* \(.*\)/\1/p" | cut -c19-25 ) + +git branch --contains $COMMIT | grep "master" &> /dev/null +if [ $? == 0 ]; then + echo "ghana.janbaudisch.de" && exit 0 +fi + +git branch --contains $COMMIT | grep "review" &> /dev/null +if [ $? == 0 ]; then + echo "review.ghana.janbaudisch.de" && exit 0 +fi + +exit 1 diff --git a/static/CNAME b/static/CNAME deleted file mode 100644 index 91b6ca5..0000000 --- a/static/CNAME +++ /dev/null @@ -1 +0,0 @@ -ghana.janbaudisch.de -- 2.45.2