Skip to content
Merged
Show file tree
Hide file tree
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
27 changes: 26 additions & 1 deletion .github/workflows/docs_preview_build_cf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ name: "CF: Build Docs Preview"

on:
pull_request:
types: [opened, synchronize, reopened, labeled]
paths:
- 'docs/**'
- '.github/workflows/docs*_cf.yaml'
Expand All @@ -26,6 +27,7 @@ permissions: read-all

jobs:
build-preview:
if: "contains(github.event.pull_request.labels.*.name, 'docs: deploy-preview')"
runs-on: ubuntu-24.04
env:
PR_NUMBER: ${{ github.event.number }}
Expand Down Expand Up @@ -86,4 +88,27 @@ jobs:
echo "The build for PR #${{ env.PR_NUMBER }} succeeded." >> $GITHUB_STEP_SUMMARY
echo "The Cloudflare deployment workflow is now starting." >> $GITHUB_STEP_SUMMARY
echo "---" >> $GITHUB_STEP_SUMMARY
echo "#### [Track Deployment Progress]($DEPLOY_URL)" >> $GITHUB_STEP_SUMMARY
echo "#### [Track Deployment Progress]($DEPLOY_URL)" >> $GITHUB_STEP_SUMMARY

remove-label:
needs: build-preview
if: "always() && contains(github.event.pull_request.labels.*.name, 'docs: deploy-preview')"
runs-on: ubuntu-24.04
permissions:
pull-requests: write
steps:
- name: Remove deploy-preview label
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
with:
script: |
try {
await github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
name: 'docs: deploy-preview'
});
console.log("Label 'docs: deploy-preview' removed successfully.");
} catch (error) {
console.log(`Error removing label: ${error}`);
}
1 change: 1 addition & 0 deletions DEVELOPER.md
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@ go test -race -v ./cmd/... ./internal/...
workflows on your PR.
* Maintainers can comment `/gcbrun` to execute the integration tests.
* Maintainers can add the label `tests:run` to execute the unit tests.
* Maintainers can add the label `docs: deploy-preview` to run the PR Preview workflow.

#### Test Resources

Expand Down
Loading