Skip to content

Suggestion: PR Preview Github Action Workflows #30

@rbuckton

Description

@rbuckton

I noticed the proposal template repo has a build.yml github action. I recently wrote something similar for https://github.com/tc39/proposal-class-static-block that might be a useful improvement:

  • build.yml:
    • Uses JamesIves/[email protected] to deploy output to the gh-pages branch
    • Excludes pr/ folder from clean deployment
  • pr.yml:
    • Uses JamesIves/[email protected] to deploy output to the gh-pages branch under pr/<number>
    • Generates a preview URL using https://tc39.es/<repository>/pr/<number>
    • Uses phulsechinmay/[email protected] to post a comment to the PR with a link to the generated preview:
      example

By publishing to gh-pages you don't need to check in the docs folder (which can be safely added to .gitignore), which makes PR diffs easier to read.

NOTE: This does not currently do any kind of automatic pruning generated PR outputs, so that the links in a PR remain working. Pruning stale PR renders is a manual process that can be done by deleting PR-specific subfolders under the pr folder in the gh-pages branch using the GitHub UI.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions