-
Notifications
You must be signed in to change notification settings - Fork 535
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create preproductionDeployment.yml #23167
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 1 out of 1 changed files in this pull request and generated no suggestions.
Tip: Copilot code review supports C#, Go, Java, JavaScript, Markdown, Python, Ruby and TypeScript, with more languages coming soon. Learn more
# Step 3: Install Dependencies | ||
- name: Install Dependencies | ||
run: | | ||
cd docs | ||
pnpm i --frozen-lockfile | ||
pnpm run build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest splitting the actual build into its own step
- name: Install pnpm | ||
run: npm install -g pnpm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if corepack enable
would accomplish the same thing here. It's what we have to run locally during a first-time setup of the repo. @tylerbutler might know?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely follow the patterns used by the other GitHub action-based workflows.
# Step 5: Post Deployment Feedback (Optional) | ||
- name: Post Deployment URL as PR Comment | ||
if: success() | ||
uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
const url = '${{ steps.deploy.outputs.preview_url }}'; | ||
github.issues.createComment({ | ||
issue_number: context.issue.number, | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
body: `✅ **Pre-production Deployment Successful** 🚀\n\nYou can view the changes here: ${url}` | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if there's two concurrent PRs making changes to the site? Does each of them get their own separate URL?
@@ -0,0 +1,70 @@ | |||
name: Preproduction Deployment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add docs to the top of this template explaining what it does 😁
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there an advantage to this being a GH workflow rather than an ADO pipeline? In the past, it was a lot easier to publish comments and whatnot using GitHub actions - but those advantages aren't really relevant anymore. Jatin recently added some common functions to build-tools that can create/update comments on PRs, etc. So my suggestion is that unless there's some advantage I'm not seeing, an ADO pipeline is better. It should have access to deployment tokens and whatnot too.
Adds preproduction deployment Github Action