Skip to content

Commit

Permalink
Create auto-update.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
mmdjiji committed Jun 8, 2023
1 parent 128a2b9 commit 25cd3c2
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions workflows-demo/auto-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Auto update
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *' # Every day

jobs:
meta:
name: Update meta
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: main

- name: Do meta update
shell: bash
run: |
npm install
npx hexo bangumis -u || echo
- name: Commit files
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add .
git commit -m "Update meta on $(date '+%Y-%m-%d %H:%M:%S')" || echo
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}

- name: Do build
shell: bash
run: |
npm run build
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: public # The folder the action should deploy.

0 comments on commit 25cd3c2

Please sign in to comment.