From 97d7cc5739c52551346241e9b3426180efa3bec8 Mon Sep 17 00:00:00 2001 From: Reco Date: Wed, 29 May 2024 02:55:34 +0800 Subject: [PATCH] Update github_page.yml --- .github/workflows/github_page.yml | 41 +++++++++++++++++++------------ 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/.github/workflows/github_page.yml b/.github/workflows/github_page.yml index 98cb722..8564286 100644 --- a/.github/workflows/github_page.yml +++ b/.github/workflows/github_page.yml @@ -11,36 +11,45 @@ jobs: pages: write id-token: write steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Setup Node.js + uses: actions/setup-node@v1 with: node-version: 20 cache: npm - - name: Enter Directory - run: cd docs - - - name: ls - run: ls - - - name: Install + - name: Verify and navigate to docs directory + run: | + if [ -d "./docs" ]; then + echo "Directory exists" + cd docs + else + echo "Directory does not exist" + exit 1 + fi + + - name: Install dependencies run: npm install working-directory: ./docs - - name: ls - run: ls + - name: List files in docs directory after install + run: ls -la + working-directory: ./docs - - name: Build - run: vuepress build . + - name: Build the VuePress site + run: npx vuepress build . working-directory: ./docs - - name: ls - run: ls + - name: List built files + run: ls -la + working-directory: ./docs/.vuepress/dist - name: Deploy to GitHub Pages uses: crazy-max/ghaction-github-pages@v2 with: target_branch: pages-code - build_dir: .vuepress/dist + build_dir: docs/.vuepress/dist env: GITHUB_TOKEN: ${{ secrets.PAGE_TOKEN }}