Skip to content

Merge pull request #7 from guguming/dependabot/npm_and_yarn/hexo-them… #10

Merge pull request #7 from guguming/dependabot/npm_and_yarn/hexo-them…

Merge pull request #7 from guguming/dependabot/npm_and_yarn/hexo-them… #10

Workflow file for this run

name: Deploy Hexo to GitHub Pages
on:
push:
branches: [ main ]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout main
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
- name: Cache Hexo files
uses: actions/cache@v4
with:
path: |
db.json
.deploy_git
public
key: hexo-${{ runner.os }}-${{ hashFiles('_config.yml', '_config.next.yml', 'package-lock.json') }}
restore-keys: |
hexo-${{ runner.os }}-
- name: Install dependencies
run: npm ci
- name: Clean and generate
run: |
npm run clean
npm run build
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
publish_branch: deploy
force_orphan: true
enable_jekyll: false