From cec678cee1d70fced931c355d1874fdae607c0bf Mon Sep 17 00:00:00 2001 From: your-user-name Date: Wed, 24 Apr 2024 13:00:53 +0800 Subject: [PATCH] Update pages.yml --- .github/workflows/pages.yml | 43 ++++++++++++++++++++++++++----------- 1 file changed, 30 insertions(+), 13 deletions(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 1a61729..8e979c2 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -1,22 +1,39 @@ name: Pages -on: push +on: + push: + branches: + - main jobs: - publish: + build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: - node-version: '14' + node-version: '18' + - uses: actions/cache@v4 + with: + path: node_modules + key: ${{ runner.OS }}-npm-cache + restore-keys: | + ${{ runner.OS }}-npm-cache - run: npm install - # - run: npx hexo algolia - # env: - # HEXO_ALGOLIA_INDEXING_KEY: ${{ secrets.HEXO_ALGOLIA_INDEXING_KEY }} - - run: NODE_ENV=production npx hexo g - - uses: peaceiris/actions-gh-pages@v3 + - run: npm run build + - uses: actions/upload-pages-artifact@v3 with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./public - force_orphan: true \ No newline at end of file + path: public + deploy: + needs: build + permissions: + pages: write + id-token: write + environment: + name: github-pages + url: lzuoss.github.io + runs-on: ubuntu-latest + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 \ No newline at end of file