docs.yml 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. name: Deploy Docs
  2. on:
  3. push:
  4. branches:
  5. - main
  6. permissions:
  7. contents: read
  8. jobs:
  9. deploy:
  10. runs-on: ubuntu-latest
  11. permissions:
  12. contents: write #needed to publish documentation
  13. steps:
  14. - uses: step-security/harden-runner@fe104658747b27e96e4f7e80cd0a94068e53901d # v2.16.1
  15. with:
  16. egress-policy: audit
  17. - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
  18. with:
  19. fetch-depth: 0
  20. persist-credentials: false
  21. - name: Setup Go
  22. uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
  23. with:
  24. go-version-file: "go.mod"
  25. - name: Configure Git
  26. env:
  27. TOKEN: ${{ secrets.GITHUB_TOKEN }}
  28. GH_REPO: ${{ github.repository }}
  29. run: |
  30. git config user.name "$GITHUB_ACTOR"
  31. git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
  32. git remote set-url origin "https://x-access-token:${TOKEN}@github.com/${GH_REPO}.git"
  33. - name: Build Docs
  34. run: make docs.publish
  35. env:
  36. GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"