name: Build and Deploy on: [ push, pull_request ] jobs: build-and-deploy: runs-on: ubuntu-latest environment: name: github-pages steps: - name: Checkout uses: actions/checkout@v3 - name: Setup Node.js environment uses: actions/setup-node@v3.7.0 with: node-version: "12.x" - name: Install dependencies run: npm install - name: Build run: npm run docs:build - name: Deploy run: | pwd cd docs/.vuepress/dist/ pwd git init git config --global user.name "github-actions[bot]" git config --global user.email "${{ secrets.DRAGONOS_EMAIL }}" git branch git branch -m gh-pages && git checkout gh-pages git add . git commit -m "deploy" git push -f git@github.com:DragonOS-Community/OS_lab_tutorial.git gh-pages cd -