ci: Preview docs for PRs

This commit is contained in:
Kévin Commaille 2022-06-20 13:37:38 +02:00 committed by Kévin Commaille
parent fa4ad103f4
commit 1a36508806

View File

@ -249,8 +249,28 @@ jobs:
- name: Build docs
run: target/debug/xtask doc --deny-warnings
- 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 branch
- 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: