发布:杭州集章特种兵行动 #235
This file contains 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: build | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
deploy: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- name: Setup Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '14.16.0' | |
- name: Install dependencies | |
run: npm install | |
- name: Setup Hugo | |
uses: peaceiris/actions-hugo@v2 | |
with: | |
hugo-version: '0.100.2' | |
extended: true | |
- name: Build | |
run: npm run build | |
- name: Deploy | |
env: | |
TZ: Asia/Shanghai | |
DEPLOY_REPO: guanqr/guanqr.github.io | |
DEPLOY_BRANCH: master | |
PERSONAL_TOKEN: ${{ secrets.PERSONAL_TOKEN }} | |
run: | | |
cd ./public && git init | |
git config user.name "guanqr" | |
git config user.email "[email protected]" | |
git add . | |
git commit -m "Automated Deployment @ $(date '+%Y-%m-%d %H:%M:%S') ${TZ}" | |
git push --force --quiet "https://[email protected]/$DEPLOY_REPO" master:$DEPLOY_BRANCH |