Skip to content

Commit

Permalink
Update pages.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Petalzu authored Apr 24, 2024
1 parent 4ec247e commit 67a1e8c
Showing 1 changed file with 26 additions and 37 deletions.
63 changes: 26 additions & 37 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,37 @@
name: Pages

on:
push:
branches:
- master # default branch
on: [push, pull_request]

jobs:
build:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14, latest]
fail-fast: false
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
# If your repository depends on submodule, please see: https://github.com/actions/checkout
submodules: recursive
- name: Use Node.js 18.16.0
uses: actions/setup-node@v3
repository: hexojs/hexo-starter
- uses: actions/checkout@v3
with:
node-version: '18.16.0'
- name: Cache NPM dependencies
uses: actions/cache@v3
path: themes/icarus
- uses: actions/checkout@v3
with:
path: node_modules
key: ${{ runner.OS }}-npm-cache
restore-keys: |
${{ runner.OS }}-npm-cache
- name: Install Dependencies
run: npm install
- name: Build
run: npm run build
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v2
repository: SukkaLab/hexo-many-posts
path: source/_posts/hexo-many-posts
- uses: actions/setup-node@v3
with:
path: ./public
deploy:
needs: build
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
node-version: ${{ matrix.node-version }}
- uses: actions/cache@v3
with:
path: node_modules
key: npm-cache
restore-keys: npm-cache
- run: npm install
- run: >
npm install $(node -e "const deps=require('./themes/icarus/package.json').dependencies;
console.log(Object.keys(deps).map(key=>key+'@'+deps[key]).join(' '));")
- run: npm install hexo-tag-embed
- run: npx hexo config theme icarus
- run: time NODE_ENV=production npx hexo g -b

0 comments on commit 67a1e8c

Please sign in to comment.