chore(ci): add per-PR Azion preview deploy workflow - #2309
Closed
marcus-souza-azion wants to merge 1 commit into
Closed
chore(ci): add per-PR Azion preview deploy workflow#2309marcus-souza-azion wants to merge 1 commit into
marcus-souza-azion wants to merge 1 commit into
Conversation
marcus-souza-azion
force-pushed
the
chore/pr-preview-deploys
branch
2 times, most recently
from
August 5, 2026 23:22
e47743a to
03e1c63
Compare
Deploys each pull request to its own Azion workload, named
docs-preview-pr-<number>, and comments the URL on the PR. Two open PRs never
share a URL because they never share a workload. `azion link --name` sets the
application name, so no config templating is involved.
Uses `azion deploy --local`: the remote builder runs out of memory above a 4 GB
heap and this site needs more, so the runner does the build and uploads the
result.
Adds azion/ and .edge/ to .gitignore. This is load-bearing rather than hygiene:
azion/azion.json holds the application and workload IDs the working copy is
linked to, and committing it would make every PR deploy into the same workload
and overwrite the others.
Two things learned from running this against CLI 4.22.2, both reflected here:
- Deploy runs without --format json and without --out. Those flags swallow
every error: a failing deploy writes `{"error": {}}` and nothing else,
while plain output prints the real message. `list` keeps --format json
because reads are unaffected, which is why the URL is resolved from a
workload lookup rather than the deploy output.
- The preset is spelled Astro, matching the value the CLI shows in its own
picker, rather than lowercase.
A step after link dumps the working directory, azion/, azion.json,
azion.config.*, and .edge/. Deploy fails in about two seconds with "Failed to
open the azion.json file" when no config is present, so seeing what link
actually produced is the difference between a diagnosable run and a mystery.
Deliberate limits for this first version, all commented in the file:
- Fork PRs skip instead of failing. They receive no secrets, so there is no
token to deploy with.
- Draft PRs skip. Marking one ready for review triggers the preview.
- A paths filter keeps docs-only and config-only PRs from paying for a build.
This workflow file is in that filter so changes to the preview can be
tested by the PR that makes them.
Teardown on PR close is a separate workflow, not in this commit. It needs
pull_request_target to get a token on a closed fork PR, and it has to resolve
the workload name to an ID first, because `azion delete workload` takes
--workload-id rather than a name.
marcus-souza-azion
force-pushed
the
chore/pr-preview-deploys
branch
from
August 5, 2026 23:27
03e1c63 to
d739ea0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Deploys every pull request to its own Azion workload and comments the URL on the PR.
Reviewers currently judge documentation changes from an MDX diff. This gives them the rendered page. Previews are the lowest-risk place to change that, because a broken preview is invisible to readers.
Related issue: none
Pages affected: none. Adds
.github/workflows/pr-preview.ymland two.gitignoreentries.Type of change
feat)fix) — typo, broken link, wrong informationdocs) — rewrite, expansion, upkeepi18n)refactor/chore) — reviewed by UXE, no content mixed inAuthor checklist
type(scope): summary