build.yml 919 B

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