update date #109
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: Blog CI/CD | |
on: | |
push: | |
branches: | |
- master | |
env: | |
TZ: Asia/Shanghai | |
jobs: | |
blog-cicd: | |
name: Hexo blog build & deploy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout codes | |
uses: actions/checkout@v2 | |
- name: Setup node | |
uses: actions/setup-node@v1 | |
with: | |
node-version: '14.x' | |
- name: Cache node modules | |
uses: actions/cache@v4 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
- name: Install hexo dependencies | |
run: | | |
npm install hexo -g | |
npm install | |
- name: Clean | |
run: | | |
hexo clean | |
- name: Update bangumi data | |
run: | | |
hexo cinema -u | |
hexo bangumi -u | |
- name: Generate files | |
run: | | |
hexo generate | |
- name: Deploy hexo blog | |
env: | |
GITHUB_REPO: github.com/bigcat26/bigcat26.github.io | |
run: | | |
cd ./public && git init . | |
git config --local user.name "bigcat26" | |
git config --local user.email "[email protected]" | |
git add . | |
git commit -m "GitHub Actions Auto Builder at $(date +'%Y-%m-%d %H:%M:%S')" | |
git push --force --quiet "https://${{ secrets.ACCESS_TOKEN }}@$GITHUB_REPO" master:gh-pages |