ci: Preview docs for PRs
@@ -250,7 +250,27 @@ jobs:
- name: Build docs
run: target/debug/xtask doc --deny-warnings
- - name: Deploy to docs branch
+ - name: Deploy PR preview
+ if: ${{ github.event_name == 'pull_request' }}
+ uses: dswistowski/surge-sh-action@v1.0.1
+ with:
+ domain: pr-${{ github.event.number }}--ruma-docs.surge.sh
+ project: target/doc
+ login: ${{ secrets.SURGE_LOGIN }}
+ token: ${{ secrets.SURGE_TOKEN }}
+
+ - name: Comment deploy PR preview URL
+ if: ${{ github.event_name == 'pull_request' }}
+ uses: Beakyn/gha-comment-pull-request@v1.0.2
+ id: deploy-preview
+ env:
+ GITHUB_TOKEN: ${{ github.token }}
+ with:
+ description-message: |
+ ----
+ Preview: https://pr-${{ github.event.number }}--ruma-docs.surge.sh
+
+ - name: Deploy to docs repo
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
uses: JamesIves/github-pages-deploy-action@4.1.4
with:
