diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 50920d3..81377fa 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -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