Cleans all preview pages for gh-pages #962
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Cleans all preview pages for gh-pages | |
on: | |
schedule: | |
- cron: "0 0 * * *" | |
jobs: | |
clean: | |
name: Clean | |
runs-on: ubuntu-24.04 # Use Ubuntu 24.04 explicitly | |
steps: | |
- name: ⏬ Checkout repo | |
uses: actions/checkout@v4 | |
- name: 📥 Get gh-pages tar | |
run: wget --quiet https://github.com/db-ux-design-system/core-web/tarball/gh-pages | |
- name: ➕ Create public dir | |
run: mkdir public | |
- name: 📦 Unpack Tar | |
run: tar --gzip --extract --file gh-pages --directory public --strip-components 1 | |
- name: 🗑️ Clean all preview pages | |
id: cleanup | |
uses: actions/github-script@v7 | |
with: | |
result-encoding: json | |
script: | | |
const { default: cleanUpPages } = await import('${{ github.workspace }}/scripts/github/cleanup-gh-pages.js'); | |
return await cleanUpPages({github, context}); | |
- name: 🥅 Deploy to GH-Pages | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./public |