Publish the page with git-pages
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
1e437015d2
commit
8804d6873c
3 changed files with 22 additions and 2 deletions
|
|
@ -10,3 +10,23 @@ jobs:
|
|||
docker:
|
||||
uses: infra/ci-snippets/.forgejo/workflows/docker-build.yml@master
|
||||
secrets: inherit
|
||||
|
||||
pages:
|
||||
if: github.ref_name == github.event.repository.default_branch
|
||||
runs-on: default
|
||||
container:
|
||||
image: ruby:latest
|
||||
steps:
|
||||
- run: apt-get update && apt-get install -y nodejs
|
||||
- uses: https://code.forgejo.org/actions/checkout@v7
|
||||
- name: Build site
|
||||
run: |
|
||||
mkdir _site
|
||||
ruby -r yaml -r json -e 'puts YAML.load($stdin.read).to_json' < config.yml > _site/config.json
|
||||
cp index.html script.js style.css _site/
|
||||
- uses: https://codeberg.org/git-pages/action@v2.2.0
|
||||
with:
|
||||
site: https://jonasled.jonasled.dev/package-mirror/
|
||||
source: _site/
|
||||
token: ${{ forgejo.token }}
|
||||
comment: ${{ forgejo.sha }}
|
||||
|
|
|
|||
|
|
@ -2,4 +2,4 @@
|
|||
|
||||
Static page for the package mirror. `config.yml` is converted to `config.json` inside the Docker image build and served with darkhttp.
|
||||
|
||||
CI (`.forgejo/workflows/ci.yml`) builds and pushes the image. The old GitLab Pages job that published the page is not ported: Forgejo has no Pages (jonasled/k8s-flux issue 5).
|
||||
CI (`.forgejo/workflows/ci.yml`) builds and pushes the image and publishes the page to git-pages (https://jonasled.jonasled.dev/package-mirror/).
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ const configurationDiv = document.getElementById("configuration");
|
|||
const commentDiv = document.getElementById("comment");
|
||||
|
||||
async function generatePage() {
|
||||
const config = await (await fetch("https://package-mirror-4bdcf5.jonasled.dev/config.json")).json();
|
||||
const config = await (await fetch("config.json")).json();
|
||||
config.forEach(category => {
|
||||
let button = document.createElement("button");
|
||||
button.innerText = category["name"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue