Skip to content

Commit

Permalink
feat: update deploy github pages workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ahonn committed Feb 4, 2024
1 parent 4fd8c6e commit 2e4c073
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 38 deletions.
38 changes: 0 additions & 38 deletions .github/workflows/deploy.yml

This file was deleted.

53 changes: 53 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: GitHub Pages

on:
push:
branches:
- master
- demo-source

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@master
with:
ref: demo-source
- name: Use Node.js
uses: actions/setup-node@master
with:
node-version: '18.x'
- name: Cache NPM dependencies
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.OS }}-npm-cache
restore-keys: |
${{ runner.OS }}-npm-cache
- name: Prepare source
run: |
npm install hexo-renderer-ejs hexo-renderer-dartsass --save
git clone -b master https://github.com/ahonn/hexo-theme-even.git themes/even
cp themes/even/_config.yml.example themes/even/_config.yml
- name: Install Dependencies
run: npm install
- name: Build
run: npm run build
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v2
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

0 comments on commit 2e4c073

Please sign in to comment.