-
Notifications
You must be signed in to change notification settings - Fork 213
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update deploy github pages workflow
- Loading branch information
Showing
2 changed files
with
55 additions
and
38 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
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 i -g hexo-cli | ||
hexo generate | ||
- 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 |