1
0

website.yml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. name: Website
  2. on:
  3. push:
  4. paths: ['website/**']
  5. pull_request:
  6. paths: ['website/**']
  7. jobs:
  8. checks:
  9. runs-on: ubuntu-latest
  10. steps:
  11. - uses: actions/checkout@v2
  12. - uses: actions/setup-node@v2
  13. with:
  14. node-version: '14'
  15. - name: Test Build
  16. run: |
  17. cd website
  18. npm install
  19. npm run build
  20. publish:
  21. if: github.repository_owner == 'premake' && github.event_name == 'push' && github.ref == 'refs/heads/master'
  22. runs-on: ubuntu-latest
  23. steps:
  24. - uses: actions/checkout@v2
  25. with:
  26. fetch-depth: 0
  27. - uses: actions/setup-node@v2
  28. with:
  29. node-version: '14'
  30. - name: Add key to allow access to repository
  31. env:
  32. SSH_AUTH_SOCK: /tmp/ssh_agent.sock
  33. run: |
  34. mkdir -p ~/.ssh
  35. ssh-keyscan github.com >> ~/.ssh/known_hosts
  36. echo "${{ secrets.WEBSITE_DEPLOY_KEY }}" > ~/.ssh/id_rsa
  37. chmod 600 ~/.ssh/id_rsa
  38. cat <<EOT >> ~/.ssh/config
  39. Host github.com
  40. HostName github.com
  41. IdentityFile ~/.ssh/id_rsa
  42. EOT
  43. - name: Release to premake.github.io
  44. env:
  45. USE_SSH: true
  46. GIT_USER: git
  47. DEPLOYMENT_BRANCH: master
  48. run: |
  49. git config --global user.email "[email protected]"
  50. git config --global user.name "gh-actions"
  51. cd website
  52. npm install
  53. npx docusaurus deploy