From ed2c933a28cbefdf112b64ef40f14625d466f92e Mon Sep 17 00:00:00 2001 From: JulianGonzalezO Date: Thu, 5 Feb 2026 16:04:50 -0500 Subject: [PATCH 1/3] Add GitHub Pages workflow and wallpapers bundle build script --- .github/workflows/publish-pages.yml | 36 +++++++++++++++++++++++++++++ build-wallpapers.js | 27 ++++++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 .github/workflows/publish-pages.yml create mode 100644 build-wallpapers.js diff --git a/.github/workflows/publish-pages.yml b/.github/workflows/publish-pages.yml new file mode 100644 index 0000000..da11dbc --- /dev/null +++ b/.github/workflows/publish-pages.yml @@ -0,0 +1,36 @@ +name: Build & Publish Wallpapers (GitHub Pages) + +on: + push: + branches: [gh-pages] + workflow_dispatch: + +permissions: + contents: write + +concurrency: + group: pages-publish + cancel-in-progress: true + +jobs: + build-and-publish: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Build bundle + run: node scripts/build-wallpapers.js + + - name: Publish to gh-pages + uses: peaceiris/actions-gh-pages@v4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: dist + publish_branch: gh-pages + force_orphan: true diff --git a/build-wallpapers.js b/build-wallpapers.js new file mode 100644 index 0000000..2e774c4 --- /dev/null +++ b/build-wallpapers.js @@ -0,0 +1,27 @@ +const fs = require('fs'); +const path = require('path'); + +const OUT_DIR = path.join(__dirname, 'dist'); +fs.mkdirSync(OUT_DIR, { recursive: true }); + +const jsonsDir = path.join(__dirname, 'jsons'); +const wallpapersFile = path.join(OUT_DIR, 'wallpapers.json'); + +const wallpapersData = {}; + +const jsonFiles = fs.readdirSync(jsonsDir) + .filter(file => file.endsWith('.json')) + .sort(); + +const wallpapers = []; +for (const file of jsonFiles) { + const filePath = path.join(jsonsDir, file); + const data = JSON.parse(fs.readFileSync(filePath, 'utf8')); + wallpapers.push(data); +} + +wallpapersData.wallpapers = wallpapers; + +fs.writeFileSync(wallpapersFile, JSON.stringify(wallpapersData, null, 2) + '\n', 'utf8'); + +console.log(`Successfully merged ${wallpapers.length} wallpapers`); \ No newline at end of file From 772a6303ef56ed72fc54c7f723f3a86d9fbc40ae Mon Sep 17 00:00:00 2001 From: JulianGonzalezO Date: Thu, 5 Feb 2026 16:07:45 -0500 Subject: [PATCH 2/3] Fix script path --- .github/workflows/publish-pages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-pages.yml b/.github/workflows/publish-pages.yml index da11dbc..a8438eb 100644 --- a/.github/workflows/publish-pages.yml +++ b/.github/workflows/publish-pages.yml @@ -25,7 +25,7 @@ jobs: node-version: 20 - name: Build bundle - run: node scripts/build-wallpapers.js + run: node build-wallpapers.js - name: Publish to gh-pages uses: peaceiris/actions-gh-pages@v4 From 97b6a561ddf04736b81c36a29b4692f5f3603440 Mon Sep 17 00:00:00 2001 From: JulianGonzalezO Date: Thu, 5 Feb 2026 16:13:35 -0500 Subject: [PATCH 3/3] Update publish-pages workflow to trigger on main branch instead of gh-pages --- .github/workflows/publish-pages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-pages.yml b/.github/workflows/publish-pages.yml index a8438eb..3057898 100644 --- a/.github/workflows/publish-pages.yml +++ b/.github/workflows/publish-pages.yml @@ -2,7 +2,7 @@ name: Build & Publish Wallpapers (GitHub Pages) on: push: - branches: [gh-pages] + branches: [main] workflow_dispatch: permissions: