Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 1, 2025

Extracted Netlify documentation deployment from the main build pipeline into a reusable workflow that can be called by other workflows or triggered manually. The main build pipeline now uses this workflow to deploy documentation, maintaining automatic deployments while also enabling manual triggers.

Changes

  • New reusable workflow: .github/workflows/deploy-documentation-netlify.yml

    • Supports workflow_call trigger for being called by other workflows with pre-built artifacts
    • Supports workflow_dispatch trigger for manual execution with PR number input
    • Accepts optional pr_number, draft, and artifact_name inputs
    • When called from build-status.yml, reuses pre-built artifacts (no rebuild)
    • When triggered manually, builds production packages and documentation from scratch
    • Deploys to Netlify via API
    • Comments on PR with deployment URL on success
    • Comments on PR with workflow run link on failure
  • Updated: .github/workflows/build-status.yml

    • Now calls the reusable workflow instead of inline deployment steps
    • Maintains automatic deployment on every commit to main (production mode)
    • Maintains automatic deployment for PRs (draft mode)
    • Passes pre-built website artifacts to avoid rebuilding

Usage

Automatic (via build-status.yml)

  • Deploys automatically on every commit to main (production)
  • Deploys automatically for every PR (draft with preview comment)

Manual

# Trigger via GitHub UI: Actions → Deploy Documentation to Netlify
# Or via gh CLI:
gh workflow run deploy-documentation-netlify.yml -f pr_number=123

The workflow centralizes Netlify deployment logic, eliminating duplication while supporting both automatic CI/CD deployments and on-demand manual deployments.

Original prompt

in my main workflow, I have a step pushing artifacts on netlify. I want to extract it into a new workflow asking for the Id of the pr, building the website, pushing it on netlify and commenting on the pr in case of success (but also failure in such case a link to the failing execution would be great)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@changeset-bot
Copy link

changeset-bot bot commented Nov 1, 2025

⚠️ No Changeset found

Latest commit: ed77c75

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copilot AI changed the title [WIP] Extract Netlify artifact step into new workflow Extract Netlify deployment into standalone workflow Nov 1, 2025
Copilot AI requested a review from dubzzz November 1, 2025 09:49
Copilot finished work on behalf of dubzzz November 1, 2025 09:49
@dubzzz
Copy link
Owner

dubzzz commented Nov 1, 2025

@copilot actually I changed my mind, I want to keep the publication to netlify for each commit merged on main. So your new workflow does not need to ask if it's for a draft or not. Except if this workflow can be triggered by the legacy workflow with the artifacts it just built

Copy link
Contributor Author

Copilot AI commented Nov 1, 2025

@copilot actually I changed my mind, I want to keep the publication to netlify for each commit merged on main. So your new workflow does not need to ask if it's for a draft or not. Except if this work...

I've converted the workflow to a reusable workflow that addresses both requirements:

  1. Keeps automatic Netlify publication - The build-status.yml workflow continues to deploy on every commit to main (production) and for PRs (draft), using the artifacts it builds.

  2. Can be called with existing artifacts - The new workflow supports workflow_call, so build-status.yml passes its pre-built website artifacts directly without rebuilding.

  3. Can still be triggered manually - When triggered via workflow_dispatch, it builds the documentation from scratch for the specified PR.

The workflow automatically determines draft mode: false for main branch pushes, true for everything else. (commit ed77c75)

Copilot AI changed the title Extract Netlify deployment into standalone workflow Extract Netlify deployment into reusable workflow Nov 1, 2025
Copilot finished work on behalf of dubzzz November 1, 2025 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants