Skip to content

Conversation

@sebawo
Copy link
Collaborator

@sebawo sebawo commented Jan 30, 2026

Add a single reusable workflow for Docusaurus documentation: build, test (optional), and deploy to GitHub Pages. Remove the former composite actions in favor of the workflow only.

Changes

Added

  • reusable-docusaurus.yml – One reusable workflow with one job (docusaurus): checkout, setup Node.js (pinned ref), build docs, (optional) run tests, upload pages artifact, deploy to GitHub Pages. Build runs once; no duplicate jobs.

Callers use one workflow_call to run build, test, and deploy in a single job.

Security

  • Pin smartcontractkit/.github/actions/setup-nodejs to commit hash (setup-nodejs@0.2.3) to satisfy CodeQL unpinned-action requirement.

Removed

  • actions/docs-test/ – Composite action removed; use reusable workflow instead.
  • actions/docs-deploy/ – Composite action removed; use reusable workflow instead.
  • .changeset/docs-actions-minor.md – No longer versioning the removed actions.

Other

  • pnpm-lock.yaml – Dropped actions/docs-test and actions/docs-deploy from lockfile.

Convert docs-test and docs-deploy composite actions to reusable workflows
for consistency with other .github workflows.
@sebawo sebawo requested a review from a team as a code owner January 30, 2026 16:52
@github-actions
Copy link
Contributor

👋 sebawo, thanks for creating this pull request!

To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team.

Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks!

…cusaurus

Single reusable workflow with two jobs: docs-test (build + test) and
docs-deploy (build + deploy to GitHub Pages). Deploy runs after test succeeds.
Remove reusable-docs-test.yml and reusable-docs-deploy.yml.
@sebawo sebawo changed the title feat(workflows): add reusable docs-test and docs-deploy workflows feat(workflows): add reusable Docusaurus workflow Jan 30, 2026
Pin smartcontractkit/.github/actions/setup-nodejs to commit hash
(43fe7fd) to resolve CodeQL unpinned-action warning.
Co-authored-by: chainchad <96362174+chainchad@users.noreply.github.com>
working-directory: ${{ inputs.docs-directory }}
env:
BUILD_COMMAND: ${{ inputs.build-command }}
run: $BUILD_COMMAND
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should get rid of the first job, and just have one job since we have to build? We coudl run build and test in this job.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chainchad good optimisation! fixed.

Remove actions/docs-test and actions/docs-deploy; Docusaurus build/test
and deploy is now only via reusable-docusaurus.yml workflow. Remove
docs-actions-minor changeset and update pnpm-lock.yaml.
Build once, then run test (if set), upload pages artifact, and deploy.
Removes duplicate build and second job (docs-deploy).
sebawo and others added 2 commits January 30, 2026 18:29
Co-authored-by: chainchad <96362174+chainchad@users.noreply.github.com>
- reusable-docusaurus: add job-level permissions (contents, pages, id-token)
  and header comment documenting required permissions; no workflow-level perms
- pull-request-main: add workflow-permissions-check job to fail when
  reusable workflows have non-empty workflow-level permissions
@chainchad chainchad enabled auto-merge (squash) January 30, 2026 18:20
id-token: write
steps:
- name: Checkout repo
if: inputs.checkout-repo == 'true'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be optional. We have it in actions because the calling job may or may not checkout the repo before calling the action.

Because this is a self-contained reusable workfow, these jobs are standalone and require a checkout.

Comment on lines +31 to +40
checkout-repo:
description: "enable git checkout repo"
required: false
type: string
default: "true"
checkout-repo-fetch-depth:
description: "number of commits to fetch"
required: false
type: string
default: "0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can delete these inputs. Checkout is no longer optional, and fetch depth seems like an unnecessary complexity.


- name: Build documentation
shell: bash
working-directory: ${{ inputs.docs-directory }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be in the docs directory or the package.json directory?

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.

3 participants