refactor: optimize node api #75
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
name: Deploy static content to Pages | |
on: | |
push: | |
branches: ["main"] | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
permissions: | |
pages: write | |
id-token: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Setup Node.js | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 20 | |
cache: npm | |
- 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: Build the VuePress site | |
run: npx vuepress build . | |
working-directory: ./docs | |
- name: Deploy to GitHub Pages | |
uses: crazy-max/ghaction-github-pages@v2 | |
with: | |
target_branch: pages-code | |
build_dir: docs/.vuepress/dist | |
env: | |
GITHUB_TOKEN: ${{ secrets.PAGE_TOKEN }} |