weblog.lol sourcehut builds integration
by Gil
Instructions
Heads up!: Start with an empty repository as the scripts only track files changed in a given commit. A file needs to have changes made to its contents in relation to the previous commit in order for the updated version of the file to be uploaded to your weblog.
If you're using macOS/Linux/UNIX: Files starting with a .
are usually hidden by your OS's file manager, as they assume it's a system file. Take that into account after renaming the .build.yml
file. Most IDEs show these files anyways and there's usually an option on your file manager to show hidden files.
- Download
example.build.yml
and replace the URL in line 7 with the read-only clone URL of your repository. If your repository's visibility is set to private, you'll want to follow sourcehut's documentation on the subject. Rename the file to.build.yml
after you're done making the necessary changes. - Download
secretvars.sh
and keep it somewhere safe outside your repo (we are going to put secret stuff in it). - In
secretvars.sh
edit line 4 and replacefoobar
with the portion of your address before the.omg.lol
part. - In
secretvars.sh
edit line 5 and replaceinsert-api-token-here
with the API key you retrieved from your account page. - In
secretvars.sh
edit line 6 and replacemyweblog
with your repo name (the part after thehttps://git.sr.ht/~foobar/
). - Navigate to the "secrets" section of sourcehut builds.
- Select "File" under "Secret Type", type
~/.secretvars
, type777
, and upload the editedsecretvars.sh
file. Give it a name, for your reference, and click "Add secret". - On the right-hand side, a new entry will appear, copy the alphanumeric identifier over the name you gave your secret on the last step.
- Edit
.build.yml
, edit line 3 replaceYOUR_SOURCEHUT_SECRET_ID
with the identifier you copied in the last step. - Add your weblog posts and pages as
.md
files under aweblog
folder and your customconfiguration.txt
andtemplate.html
files under aconfiguration
folder. - Commit and push your changes to your repo and the sourcehut builds job will automatically start. You can track its progress on the URL outputted by your console after you push your changes.
License
TL;DR: Do whatever you want with it, no attribution required (although is always apprecciated :D). You're on your own though, no warranty/support here.
The code in this repository is made available under the BSD Zero Clause License. You can read it in LICENSE
.
Improvements are always welcome!