build.yml 854 B

12345678910111213141516171819202122232425262728293031323334
  1. name: Build and Deploy
  2. on: [ push, pull_request ]
  3. jobs:
  4. build-and-deploy:
  5. runs-on: ubuntu-latest
  6. steps:
  7. - name: Checkout
  8. uses: actions/checkout@v3
  9. - name: Setup Node.js environment
  10. uses: actions/[email protected]
  11. with:
  12. node-version: "12.x"
  13. - name: Install dependencies
  14. run: npm install
  15. - name: Build
  16. run: npm run docs:build
  17. - name: Deploy
  18. run: |
  19. pwd
  20. cd docs/.vuepress/dist/
  21. pwd
  22. git init
  23. git config --global user.name "github-actions[bot]"
  24. git config --global user.email "${{ secrets.DRAGONOS_EMAIL }}"
  25. git branch gh-pages && git checkout gh-pages
  26. git add .
  27. git commit -m "deploy"
  28. git push -f [email protected]:DragonOS-Community/OS_lab_tutorial.git gh-pages
  29. cd -