Skip to content
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
9 changes: 5 additions & 4 deletions .github/workflows/vercel-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ jobs:
npm install --global vercel@latest

DEPLOY_URL=$(vercel deploy --token "$VERCEL_TOKEN" --yes | tail -1)
echo "preview-url=$DEPLOY_URL" >> $GITHUB_OUTPUT
echo "deploy-url=$DEPLOY_URL" >> $GITHUB_OUTPUT

# Sanitize branch name for DNS: lowercase, non-alphanumeric to hyphens, collapse runs
# Truncate to 46 chars so the full alias (docs-git-<branch>-authzed) stays within the 63-char DNS label limit
Expand All @@ -122,6 +122,7 @@ jobs:

vercel alias set "$DEPLOY_URL" "docs-git-${BRANCH}-authzed.vercel.app" \
--token "$VERCEL_TOKEN"
echo "alias-url=https://docs-git-${BRANCH}-authzed.vercel.app" >> $GITHUB_OUTPUT

- name: "Create GitHub Deployment"
if: "steps.permission.outputs.result == 'true'"
Expand All @@ -130,7 +131,7 @@ jobs:
with:
token: "${{ secrets.GITHUB_TOKEN }}"
environment: "Preview (GitHub Actions)"
environment-url: "${{ steps.deploy.outputs.preview-url }}"
environment-url: "${{ steps.deploy.outputs.alias-url }}"
transient-environment: true
auto-inactive: true

Expand All @@ -141,7 +142,7 @@ jobs:
token: "${{ secrets.GITHUB_TOKEN }}"
deployment-id: "${{ steps.deployment.outputs.deployment_id }}"
state: "success"
environment-url: "${{ steps.deploy.outputs.preview-url }}"
environment-url: "${{ steps.deploy.outputs.alias-url }}"

- name: "Update deployment status to failure"
if: "steps.permission.outputs.result == 'true' && failure()"
Expand Down Expand Up @@ -169,7 +170,7 @@ jobs:

| Name | Status | Preview | Updated (UTC) |
| :--- | :----- | :------ | :------------ |
| **docs** | 🟢 [Ready](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) | [Visit Preview](${{ steps.deploy.outputs.preview-url }}) | ${{ steps.timestamp-success.outputs.time }} |
| **docs** | 🟢 [Ready](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) | [Visit Preview](${{ steps.deploy.outputs.alias-url }}) | ${{ steps.timestamp-success.outputs.time }} |

- name: "Generate timestamp for failure"
if: "steps.permission.outputs.result == 'true' && failure()"
Expand Down
Loading