Skip to content

Commit

Permalink
ci: init half-baked CDN
Browse files Browse the repository at this point in the history
  • Loading branch information
NotAShelf committed Dec 7, 2024
1 parent 241161c commit 7a94f20
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/assets/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Wallpkgs</title>
</head>
<body>
<h1>Wallpkgs</h1>
<ul id="archive-list"></ul>
<script>
const baseURL = window.location.origin;
const archives = [
"catppuccin.zip",
"cities.zip",
"gruvbox.zip",
"monochrome-dark.zip",
"nature.zip",
"oxocarbon.zip",
"rose_pine.zip",
"space.zip",
"tokyo_night.zip",
];

const list = document.getElementById("archive-list");
archives.forEach((archive) => {
const li = document.createElement("li");
const link = document.createElement("a");
link.href = `${baseURL}/${archive}`;
link.textContent = archive.replace(".zip", "").replace("_", " ");
li.appendChild(link);
list.appendChild(li);
});
</script>
</body>
</html>
36 changes: 36 additions & 0 deletions .github/workflows/archive.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Generate Archives

on:
workflow_dispatch:
pull_request:
branches:
- main
push:
branches:
- main

jobs:
create-archives:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Create archives
run: |
mkdir -p archives
for dir in wallpapers/*/; do
base=$(basename "$dir")
if [ "$base" != "unorganized" ]; then
zip -r "archives/${base}.zip" "$dir"
fi
done
- name: Copy index page
run: cp -vf .github/assets/index.html archives/index.html

- name: Upload to gh-pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: archives

0 comments on commit 7a94f20

Please sign in to comment.