update-docs-config.yml 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. name: Update Docs Config
  2. on:
  3. push:
  4. branches:
  5. - main
  6. paths:
  7. - 'config/**.json'
  8. jobs:
  9. update-docs-config:
  10. name: "Update Docs Config"
  11. runs-on: ubuntu-latest
  12. if: github.repository == 'crazywhalecc/static-php-cli'
  13. steps:
  14. - name: "Checkout static-php-cli"
  15. uses: actions/checkout@v4
  16. with:
  17. ref: main
  18. path: static-php-cli
  19. - name: "Checkout static-php-cli-docs"
  20. uses: actions/checkout@v4
  21. with:
  22. repository: static-php/static-php-cli-docs
  23. ref: master
  24. token: ${{ secrets.DOCS_REPO_TOKEN }}
  25. path: static-php-cli-docs
  26. - name: "Set up Git"
  27. run: |
  28. git config --global user.email "actions@github.com"
  29. git config --global user.name "GitHub Actions"
  30. - name: "Copy Config Files"
  31. run: cp -r static-php-cli/config/* static-php-cli-docs/docs/.vitepress/config/
  32. - name: "Commit and Push Changes"
  33. run: |
  34. cd static-php-cli-docs
  35. git add -A
  36. git commit -m "Sync config files from main"
  37. git push origin master