Compare commits

..

2 commits

Author SHA1 Message Date
raf
edda78d91e
Merge 7324474ef8 into 73660af2e3 2024-12-11 02:40:04 +03:00
7324474ef8
ci: build previws for the website on doc changes 2024-12-11 02:39:59 +03:00

View file

@ -68,41 +68,59 @@ jobs:
needs: build-preview needs: build-preview
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Set preview URL - name: Prepare Environment
id: set-url id: prelude
run: | run: |
PR_NUMBER=${{ github.event.pull_request.number }} PR_NUMBER=${{ github.event.pull_request.number }}
URL="https://${{ github.repository_owner }}.github.io/nvf/docs-preview-${PR_NUMBER}/" URL="https://${{ github.repository_owner }}.github.io/nvf/docs-preview-${PR_NUMBER}/"
echo "Live Preview URL: $URL" # Propagate non-interpolatable environment vars
echo "URL=$URL" >> "$GITHUB_OUTPUT" echo "URL=$URL" >> "$GITHUB_OUTPUT"
echo "REV=$GITHUB_SHA" >> "$GITHUB_OUTPUT"
echo "ACTOR=$GITHUB_ACTOR" >> "$GITHUB_OUTPUT"
echo "REF=$GITHUB_HEAD_REF" >> "$GITHUB_OUTPUT"
echo "RUNS=$GITHUB_RUN_NUMBER" >> "$GITHUB_OUTPUT"
echo "Live Preview URL: $URL"
echo "Rev: $GITHUB_SHA"
echo "Actor: $GITHUB_ACTOR"
echo "Ref: "$GITHUB_HEAD_REF"
echo "Reruns: "$GITHUB_RUN_NUMBER"
echo "### :rocket: Live Preview Deployed " >> "$GITHUB_STEP_SUMMARY" echo "### :rocket: Live Preview Deployed " >> "$GITHUB_STEP_SUMMARY"
echo "Preview can be found at ${URL}" >> "$GITHUB_STEP_SUMMARY"" echo "Preview can be found at ${URL}" >> "$GITHUB_STEP_SUMMARY"
- name: Find Comment - name: Find Comment
uses: peter-evans/find-comment@v3 uses: peter-evans/find-comment@v3
id: fc id: fc
with: with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: "github-actions[bot]" comment-author: "github-actions[bot]"
body-includes: "Live preview is ready" issue-number: ${{ github.event.pull_request.number }}
body-includes: "Live preview deployed"
- name: Post live preview comment - name: Post live preview comment
uses: peter-evans/create-or-update-comment@v4 uses: peter-evans/create-or-update-comment@v4
env:
COMMENT_ID: ${{ steps.fc.outputs.comment-id }}
URL: ${{ steps.prelude.outputs.URL }}
GITHUB_SHA: ${{ steps.prelude.outputs.REV }}
ACTOR: ${{ steps.prelude.outputs.ACTOR }}
REF: ${{ steps.prelude.outputs.REF }}
RUNS: ${{ steps.prelude.outputs.RUNS }}
with: with:
comment-id: ${{ steps.fc.outputs.comment-id }} comment-id: ${{ env.COMMENT_ID }}
issue-number: ${{ github.event.pull_request.number }} # issue number also applies to pull requests issue-number: ${{ github.event.pull_request.number }} # issue number also applies to pull requests
edit-mode: replace # replace previous body edit-mode: replace # replace previous body
body: | body: |
### 🚀 **Live preview deployed from ${GITHUB_SHA}** ### :rocket: Live preview deployed from ${{ env.GITHUB_SHA }}
View it here: ${{ steps.set-url.outputs.URL }}
View it [here](${{ env.URL }}):
<details> <details>
<summary>Debug Information</summary> <summary><strong>Debug Information</strong></summary>
<p>Triggered by: ${GITHUB_ACTOR}</p> <p>Triggered by: ${{ env.ACTOR }}</p>
<p>HEAD at: ${GITHUB_HEAD_REF}</p> <p><code>HEAD</code> at: ${{ env.REF }}</p>
<p>Reruns: ${GITHUB_RUN_NUMBER}</p> <p>Reruns: ${{ env.RUNS }}</p>
</details> </details>
cleanup: cleanup: