~gpo/weblog.lol-build

7c7bffb0de29d20789407e9edd57e5042e18f4ee — Gil Poiares-Oliveira 8 months ago 35bb2d4 v3.0
v3.0 - Uses Alpine Linux for faster runs!
4 files changed, 11 insertions(+), 10 deletions(-)

M LICENSE
M README.md
M example.build.yml
M secretvars.sh
M LICENSE => LICENSE +1 -1
@@ 1,6 1,6 @@
BSD Zero Clause License

Copyright © 2022 Gil Oliveira
Copyright © 2022-2023 Gil Poiares-Oliveira <gil@poiares-oliveira.com>

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

M README.md => README.md +3 -3
@@ 1,10 1,10 @@
# weblog.lol sourcehut builds integration

by [Gil](https://gil.omg.lol)
by [Gil](https://gil.lol)

## 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.
**Heads up!:** It's recommended that you delete the files currently in your weblog prior to using git. To do that, add a blank `rest` file under the `configuration` folder.

**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.



@@ 18,7 18,7 @@ by [Gil](https://gil.omg.lol)
8. 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.
9. Edit `.build.yml`, edit line 3 replace `YOUR_SOURCEHUT_SECRET_ID` with the identifier you copied in the last step.
10. Add your weblog posts and pages as `.md` files under a `weblog` folder and your custom `configuration.txt` and `template.html` files under a `configuration` folder.
10. 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.
11. 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


M example.build.yml => example.build.yml +6 -5
@@ 1,19 1,20 @@
// SPDX-License-Identifier: 0BSD
// ~gpo/weblog.lol-build v2.0
// ~gpo/weblog.lol-build v3.0

image: ubuntu/lts
image: alpine/edge
secrets:
  - YOUR_SOURCEHUT_SECRET_ID
sources:
  - https://git.sr.ht/~foobar/repo
packages:
  - curl
  - php
  - php-curl
  - php8
  - php8-curl
tasks:
  - deploy: |
      . ~/.secretvars
      cd $REPO_NAME
      wget -O weblog-import.php https://api.omg.lol/address/$ADDRESS/weblog/github-action
      set +x
      php -f weblog-import.php $ADDRESS $WEBLOG_API_KEY
      php8 -f weblog-import.php $ADDRESS $WEBLOG_API_KEY


M secretvars.sh => secretvars.sh +1 -1
@@ 1,7 1,7 @@
#!/bin/sh

# SPDX-License-Identifier: 0BSD
# ~gpo/weblog.lol-build v2.0
# ~gpo/weblog.lol-build v3.0

set +x
export ADDRESS=foobar