diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml deleted file mode 100644 index 8325d48..0000000 --- a/.github/workflows/static.yml +++ /dev/null @@ -1,42 +0,0 @@ -# Simple workflow for deploying static content to GitHub Pages -name: Deploy static content to Pages - -on: - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - - repository_dispatch: - types: [run-deploy] - -# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages -permissions: - contents: read - pages: write - id-token: write - -# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. -# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. -concurrency: - group: "pages" - cancel-in-progress: false - -jobs: - # Single deploy job since we're just deploying - deploy: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Setup Pages - uses: actions/configure-pages@v5 - - name: Upload artifact - uses: actions/upload-pages-artifact@v3 - with: - # Upload entire repository - path: '.' - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml index 416f0bf..2d55da3 100644 --- a/.github/workflows/update.yml +++ b/.github/workflows/update.yml @@ -1,7 +1,4 @@ -name: update - -permissions: - contents: write +name: auto update on: schedule: @@ -11,39 +8,57 @@ on: - main workflow_dispatch: +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: "pages" + cancel-in-progress: false + + jobs: - spider: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: "3.11.x" - - run: python3 -m pip install requests - - run: python3 main.py > LATEST - - name: Commit files - id: commit-files - run: | - if [ -n "$(git status --porcelain database.json)" ]; then - git config --local user.email "github-actions[bot]@users.noreply.github.com" - git config --local user.name "github-actions[bot]" - git add . - git commit -m "$(cat LATEST)" - echo "hasChange=true" >> $GITHUB_OUTPUT - else - echo "No changes detected" - fi - - name: Push changes - uses: ad-m/github-push-action@master - if: ${{ steps.commit-files.outputs.hasChange == 'true' }} - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - branch: ${{ github.ref }} - - name: Trigger deploy - if: ${{ steps.commit-files.outputs.hasChange == 'true' }} - run: | - curl -X POST \ - -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ - -H "Accept: application/vnd.github.everest-preview+json" \ - https://api.github.com/repos/owner/repo/dispatches \ - -d '{"event_type": "run-deploy"}' \ No newline at end of file + spider: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.11.x" + - run: python3 -m pip install requests + - run: python3 main.py > LATEST + - name: Commit files + id: commit-files + run: | + if [ -n "$(git status --porcelain database.json)" ]; then + git config --local user.email "github-actions[bot]@users.noreply.github.com" + git config --local user.name "github-actions[bot]" + git add . + git commit -m "$(cat LATEST)" + echo "hasChange=true" >> $GITHUB_OUTPUT + else + echo "No changes detected" + fi + - name: Push changes + if: ${{ steps.commit-files.outputs.hasChange == 'true' }} + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: ${{ github.ref }} + - name: Setup Pages + if: ${{ steps.commit-files.outputs.hasChange == 'true' }} + uses: actions/configure-pages@v5 + - name: Upload artifact + if: ${{ steps.commit-files.outputs.hasChange == 'true' }} + uses: actions/upload-pages-artifact@v3 + with: + # Upload entire repository + path: '.' + - name: Deploy to GitHub Pages + if: ${{ steps.commit-files.outputs.hasChange == 'true' }} + id: deployment + uses: actions/deploy-pages@v4 \ No newline at end of file diff --git a/database.json b/database.json index 3d3259c..7f2a844 100644 --- a/database.json +++ b/database.json @@ -9,11 +9,6 @@ "thumb_hash": "31f7f9a78cfec6710a62a6c1fc119edd", "thumb_name": "Bilibili 10周年" }, - "0013": { - "thumb": "http://i0.hdslb.com/bfs/archive/3007728d674a385306ba0b07055103a78b9eed62.png", - "thumb_hash": "ad7bb6b7fd542862f093dedad32b7af3", - "thumb_name": "Bilibili 11周年" - }, "0014": { "thumb": "http://i0.hdslb.com/bfs/archive/1d40e975b09d5c87b11b3ae0c9ce6c6b82f63d9e.png", "thumb_hash": "de1877c33dfef853af867b01c4926d7f", diff --git "a/imgs/Bilibili 11\345\221\250\345\271\264.webp" "b/imgs/Bilibili 11\345\221\250\345\271\264.webp" deleted file mode 100644 index f35e829..0000000 Binary files "a/imgs/Bilibili 11\345\221\250\345\271\264.webp" and /dev/null differ