From d5217cdc982f26f0eabd9ef2ba605b87282dcd07 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Sat, 7 Dec 2024 13:30:37 +0300 Subject: [PATCH] ci: init half-baked CDN --- .github/workflows/archive.yml | 39 +++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/archive.yml diff --git a/.github/workflows/archive.yml b/.github/workflows/archive.yml new file mode 100644 index 0000000..1482f80 --- /dev/null +++ b/.github/workflows/archive.yml @@ -0,0 +1,39 @@ +name: Generate Archives + +on: + workflow_dispatch: + pull_request: + branches: + - main + push: + branches: + - main + +jobs: + create-archives: + runs-on: ubuntu-latest + permissions: + contents: write + + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + + 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: Upload to gh-pages + uses: peaceiris/actions-gh-pages@v4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./archives