45 lines
1.1 KiB
YAML
45 lines
1.1 KiB
YAML
name: AutoUpdate
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- 'main'
|
|
- 'dev'
|
|
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v1
|
|
with:
|
|
repository: lixbao/lixbao.github.io
|
|
- name: Set up Node
|
|
uses: actions/setup-node@v2
|
|
with:
|
|
node-version: 12
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
python-version: 3.8
|
|
- name: Build
|
|
run: |
|
|
git config --global core.quotepath false
|
|
git ls-files | while read file; do touch -d $(git log -1 --format="@%ct" "$file") "$file"; done
|
|
python3 generate.py
|
|
npm install
|
|
npm run build
|
|
- name: Commit files
|
|
run: |
|
|
git config --local user.email "actions@github.com"
|
|
git config --local user.name "GitHub Action[Bot]"
|
|
git add -A
|
|
git commit -m "update built files after user commit"
|
|
- name: Push changes
|
|
uses: ad-m/github-push-action@master
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|