From 5bb2751b0722650e7c814e02c5331acadaf1e5fb Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Fri, 12 Jan 2024 14:34:59 +0100 Subject: [PATCH] Migrate to my sourcehut instance --- .builds/publish.yml | 28 +++++++++++++++------------- .domains | 2 -- .woodpecker.yml | 16 ---------------- README.md | 25 +++++++++++++++++++++++++ README.org | 26 -------------------------- build.sh | 4 ++-- 6 files changed, 42 insertions(+), 59 deletions(-) delete mode 100644 .domains delete mode 100644 .woodpecker.yml create mode 100644 README.md delete mode 100644 README.org diff --git a/.builds/publish.yml b/.builds/publish.yml index f1a6e3f..f58c84c 100644 --- a/.builds/publish.yml +++ b/.builds/publish.yml @@ -1,3 +1,4 @@ +--- image: alpine/edge sources: - https://git.hut.ccw.icu/~comcloudway/pages @@ -7,23 +8,24 @@ packages: - sed - pandoc # deploy dependencies - - rsync + - s3fs-fuse secrets: -# file containing rsync password. -# format: RSYNC_PASSWORD="" -- c092726a-e17c-4498-adbf-90cd4771b5eb + # s3fs passwd file + - 52590bef-f27a-4b05-8262-4d14e68486e9 environment: domain: "https://ccw.icu" - target: "rsync://deploy@ccw.icu:29493/pages" + builddir: "pages/build" + s3_url: "https://s3.ccw.icu" + s3_bucket: "website" tasks: + - prepare: | + # setup s3fs + sudo modprobe fuse + sudo mv ~/.passwd-s3fs /etc/passwd-s3fs + mkdir -p $builddir + sudo s3fs $s3_bucket ~/$builddir -o url=$s3_url -o use_path_request_style -o umask=0007,uid=$(id -u) -o allow_other - builds: | cd pages bash ./build.sh $domain - - deploy: | - cd pages - set +x # hide secret - set -a # load variable from file even without export - source ~/.rsyncpass - set +a - set -x - rsync -Irtlzv ./build/* $target + - cleanup: | + sudo umount ~/$builddir diff --git a/.domains b/.domains deleted file mode 100644 index 2c6ce16..0000000 --- a/.domains +++ /dev/null @@ -1,2 +0,0 @@ -ccw.icu -www.ccw.icu diff --git a/.woodpecker.yml b/.woodpecker.yml deleted file mode 100644 index d0a076b..0000000 --- a/.woodpecker.yml +++ /dev/null @@ -1,16 +0,0 @@ ---- -pipeline: - # build static content - build: - image: alpine - commands: - - apk add bash sed pandoc - - bash ./build.sh https://ccw.icu - # publish content - publish: - image: alpine - secrets: [deploy_pass] - commands: - - apk add rsync - - export RSYNC_PASSWORD="$${DEPLOY_PASS}" - - rsync -Irtlzv ./build/* rsync://deploy@ccw.icu:29493/pages diff --git a/README.md b/README.md new file mode 100644 index 0000000..2693cb4 --- /dev/null +++ b/README.md @@ -0,0 +1,25 @@ +# ccw.icu +This repo contains the feed source code for my website. + +To view the content of my web page, +you can visit [ccw.icu](https://ccw.icu). + +# Building +## Dependencies +- `pandoc` +- `sed` +- `awk` +- `bash` + +## Deploy +To generate the HTML build output, +simply execute the `build.sh` file. +Afterwards the build output can be found in the `build/` folder. + +To get a local server running, +you can use `serve build` + +## Hosting +I'm currently serving the files directly from an `s3`-bucket using caddy. + +[![builds.sr.ht status](https://builds.hut.ccw.icu/~comcloudway/pages.svg)](https://builds.hut.ccw.icu/~comcloudway/pages?) diff --git a/README.org b/README.org deleted file mode 100644 index e2c31c0..0000000 --- a/README.org +++ /dev/null @@ -1,26 +0,0 @@ -* ccw.icu -This repo contains the feed source code for my website. - -To view the content of my web page, -you can visit [[https://ccw.icu][ccw.icu]] or explore it [[./src/index.org][locally]]. - -* Building -** Dependencies -- ~pandoc~ -- ~sed~ -- ~awk~ -- ~bash~ - -** Deploy -To generate the HTML build output, -simply execute the ~build.sh~ file. -Afterwards the build output can be found in the ~build/~ folder. - -To get a local server running, -you can use ~serve build~ - -** Hosting -I'm currently using ~nginx~ and ~rsyncd~, -running in separate docker containers. - -Have a look at my [[https://codeberg.org/comcloudway/docker-rsyncd/src/branch/main/docker-compose.yml][docker-rsyncd]] image for more information. diff --git a/build.sh b/build.sh index c186ca4..d4ac566 100755 --- a/build.sh +++ b/build.sh @@ -39,10 +39,10 @@ function convertOrg() { sed -r "s/([\.]+\/[A-z\/\.0-9_-]*)\.org/\1\.$pandocTargetExtension/g" } -# delete old build artifacts -rm -rf $builddir # create new build folder mkdir -p $builddir +# delete old build artifacts +rm -rf $builddir/* # ASSETS cp $assetdir/* -r $builddir -- 2.38.5