Skip to content

Add documentation for caching Pulumi plugins and policy packs in GitHub Actions#17224

Merged
CamSoper merged 5 commits intomasterfrom
fix_issue_17026_gh_actions_caching
Jan 30, 2026
Merged

Add documentation for caching Pulumi plugins and policy packs in GitHub Actions#17224
CamSoper merged 5 commits intomasterfrom
fix_issue_17026_gh_actions_caching

Conversation

@joeduffy
Copy link
Copy Markdown
Member

@joeduffy joeduffy commented Jan 25, 2026

This PR adds documentation for caching Pulumi plugins and policy packs in GitHub Actions workflows.

Changes

Added a new section "Caching Plugins and Policy Packs" to the GitHub Actions CI/CD documentation that explains:

  • Why caching is beneficial for improving CI performance
  • How to use GitHub's actions/cache to cache ~/.pulumi/plugins and ~/.pulumi/policies
  • Complete working examples for all supported languages (TypeScript, Python, Go, C#)
  • Smart cache key strategies using dependency file hashes
  • Advanced caching scenarios for complex setups

Context

Users running Pulumi in CI/CD environments often experience slow workflow times due to repeated plugin and policy pack downloads. This documentation provides a clear, actionable guide to implementing caching, significantly reducing workflow execution times.

The examples use dependency file hashes (e.g., package.json, requirements.txt, go.sum, *.csproj) in cache keys to ensure cache invalidation when dependencies change, while providing fallback cache restoration for maximum benefit.

Fixes #17026

…ub Actions

    This adds a new section to the GitHub Actions CI/CD documentation explaining
    how to use GitHub's actions/cache to cache Pulumi plugins and policy packs.
    Caching these artifacts significantly improves workflow execution times by
    avoiding redundant downloads on subsequent runs.

    The documentation includes:
    - Clear explanation of why caching is beneficial
    - Proper cache paths for both plugins (~/.pulumi/plugins) and policies (~/.pulumi/policies)
    - Language-specific examples for TypeScript, Python, Go, and C#
    - Smart cache key strategies using dependency file hashes
    - Additional guidance for advanced caching scenarios

    Fixes #17026
@claude

This comment was marked as resolved.

@pulumi-bot
Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Contributor

@CamSoper CamSoper left a comment

Choose a reason for hiding this comment

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

Thanks for adding this caching documentation! This will be really helpful for users looking to speed up their CI workflows.

I found one critical formatting issue that needs to be addressed:

Critical: Indentation Issue

The entire new section (lines 894-1095) has 4 spaces of leading indentation. This needs to be removed to prevent Hugo from misinterpreting the content.

File: content/docs/iac/guides/continuous-delivery/github-actions.md
Lines: 894-1095

The section should start flush left:

### Caching Plugins and Policy Packs

When running Pulumi in GitHub Actions, plugins and policy packs are downloaded on each workflow run.

All lines in the new section need this indentation removed.

Optional Improvements:

Active Voice (Line 897-898)

Consider changing to active voice:

GitHub Actions downloads plugins and policy packs on each workflow run. To improve CI performance and reduce workflow execution times, you can cache these artifacts using GitHub's [`actions/cache`](https://github.com/actions/cache).

Minor Simplification (Line 1088)

The cache key explanation could be slightly more concise:

The cache key includes a hash of your dependency files (e.g., `package.json`, `requirements.txt`, `go.sum`, or `.csproj`) to invalidate the cache when dependencies change and may require different plugins.

Once the indentation is fixed, this will be ready to merge!

Remove 4 leading spaces from entire section to align with document structure.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@CamSoper CamSoper left a comment

Choose a reason for hiding this comment

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

Applied style/formatting fixes. LGTM!

- Change to active voice: "GitHub Actions downloads" instead of "plugins and policy packs are downloaded"
- Simplify cache key explanation for better readability

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@pulumi-bot
Copy link
Copy Markdown
Collaborator

@pulumi-bot
Copy link
Copy Markdown
Collaborator

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@CamSoper CamSoper left a comment

Choose a reason for hiding this comment

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

Applied minor style/formatting fixes. LGTM!

@CamSoper CamSoper enabled auto-merge (squash) January 30, 2026 19:23
@pulumi-bot
Copy link
Copy Markdown
Collaborator

@CamSoper CamSoper merged commit 7b18390 into master Jan 30, 2026
12 checks passed
@CamSoper CamSoper deleted the fix_issue_17026_gh_actions_caching branch January 30, 2026 19:31
tehsis pushed a commit that referenced this pull request Feb 9, 2026
…ub Actions (#17224)

* Add documentation for caching Pulumi plugins and policy packs in GitHub Actions

    This adds a new section to the GitHub Actions CI/CD documentation explaining
    how to use GitHub's actions/cache to cache Pulumi plugins and policy packs.
    Caching these artifacts significantly improves workflow execution times by
    avoiding redundant downloads on subsequent runs.

    The documentation includes:
    - Clear explanation of why caching is beneficial
    - Proper cache paths for both plugins (~/.pulumi/plugins) and policies (~/.pulumi/policies)
    - Language-specific examples for TypeScript, Python, Go, and C#
    - Smart cache key strategies using dependency file hashes
    - Additional guidance for advanced caching scenarios

    Fixes #17026

* Fix markdown linting: ensure file ends with single newline

* Fix indentation in Caching Plugins and Policy Packs section

Remove 4 leading spaces from entire section to align with document structure.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* Apply style improvements: active voice and concise phrasing

- Change to active voice: "GitHub Actions downloads" instead of "plugins and policy packs are downloaded"
- Simplify cache key explanation for better readability

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* Apply style and formatting fixes

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Pulumi Assistant <claude@pulumi.com>
Co-authored-by: Cam <cam.soper@outlook.com>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
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.

Provide docs on how to cache plugins and policy packs in GitHub Actions workflows

4 participants