Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test doc preview urls (take 2) #1462

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/deploy-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ on:
paths:
- 'docs/**'
- .github/workflows/deploy-docs.yaml
# we need this in addition to push to build the docs when the PR is opened and not just on later pushes after it is open
pull_request:
paths:
- 'docs/**'
types: [opened]


jobs:
has-secrets:
Expand All @@ -30,6 +36,19 @@ jobs:
PROJECT_ID: ${{ secrets.GKE_PROD_PROJECT }}

steps:
# we do this before building the docs so that even if the docs fail building, we still have the comment on the PR for later once the build is fixed
# (we can't post the comment each time this workflow runs on we will have multiple comments, so we need to post it only once when the PR is opened)
- name: Post preview link on PR
if: github.event_name == 'pull_request'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
PR_NUMBER=$(echo ${{ github.event.pull_request.number }})
PREVIEW_URL="https://docs.robusta.dev/${GITHUB_HEAD_REF}"
curl -X POST -H "Authorization: token $GITHUB_TOKEN" \
-d "{\"body\": \"🔍 [Preview Docs](${PREVIEW_URL})\n\n**Note: preview docs will only be available at this URL once the initial docs finish building!**\"}" \
"https://api.github.com/repos/${{ github.repository }}/issues/${PR_NUMBER}/comments"

- name: Checkout
uses: actions/checkout@v2

Expand Down
Loading