Skip to content

Commit

Permalink
change workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Xsyin committed Apr 21, 2024
1 parent 1b53e04 commit b0aef3c
Showing 1 changed file with 37 additions and 30 deletions.
67 changes: 37 additions & 30 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,43 +24,50 @@ jobs:
# 缓存依赖项: https://docs.github.com/cn/actions/using-workflows/caching-dependencies-to-speed-up-workflows
- name: Cache NPM dependencies
uses: actions/cache@v4
id: cache
with:
path: node_modules
key: ${{ runner.OS }}-npm-cache
restore-keys: |
${{ runner.OS }}-npm-cache
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true' # 如果没有缓存 node_modules
run: npm install
- name: who am i
run: whoami
- name: owner 1
run: ls -l ..
- name: owner 2
run: ls -l .
- name: Clean
run: npm run clean
- name: Build
run: npm run build
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@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@v4
- name: Get the output
run: |
echo "${{ steps.deploy.outputs.notify }}"
# - name: Clean
# run: npm run clean
# - name: Build
# run: npm run build
# - name: Upload Pages artifact
# uses: actions/upload-pages-artifact@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@v4
# - name: Get the output
# run: |
# echo "${{ steps.deploy.outputs.notify }}"
- name: Deploy
id: deploy
uses: sma11black/hexo-action@v1.0.3
with:
deploy_key: ${{ secrets.HEXO_DEPLOY_KEY }}
user_name: Xsyin
user_email: shouyinxu@163.com
commit_msg: ${{ github.event.head_commit.message }}ion)
- name: Get the output
run: |
echo "${{ steps.deploy.outputs.notify }}"
sync:
needs: build
runs-on: ubuntu-latest
Expand Down

0 comments on commit b0aef3c

Please sign in to comment.