|
1 | | -# Github Actions |
| 1 | +# Variable Land — GitHub Actions |
2 | 2 |
|
3 | | -## List |
| 3 | +Reusable GitHub Actions used across Variable Land projects. |
4 | 4 |
|
5 | | -- [Setup pnpm](./actions/setup-pnpm/README.md) |
6 | | -- [Setup bun](./actions/setup-bun/README.md) |
7 | | -- [Setup pnpm + bun](./actions/setup-pnpm-bun/README.md) |
8 | | -- [Monorepo preview release](./actions/monorepo-preview-release/README.md) |
9 | | -- [Railway redeploy](./actions/railway-redeploy/README.md) |
| 5 | +## Actions |
| 6 | + |
| 7 | +| Action | Description | |
| 8 | +| --- | --- | |
| 9 | +| [`monorepo-preview-release`](./actions/monorepo-preview-release/README.md) | Publish a per-PR preview release of changed packages in a pnpm monorepo to npm (OIDC-first, with optional `NPM_TOKEN` fallback) and notify [`vland-bot`](https://bot.variable.land) so it can comment on the PR. | |
| 10 | +| [`railway-redeploy`](./actions/railway-redeploy/README.md) | Trigger a redeploy of a Railway service via the Railway GraphQL API. Resolves the target service from `project_id` + `environment` + `service_name`, so no service ID lookup is needed. | |
| 11 | +| [`setup-pnpm`](./actions/setup-pnpm/README.md) | Install pnpm, upgrade npm, cache the pnpm store, and install dependencies. | |
| 12 | +| [`setup-bun`](./actions/setup-bun/README.md) | Install Bun pinned to the version in `.bun-version`. | |
| 13 | +| [`setup-pnpm-bun`](./actions/setup-pnpm-bun/README.md) | Combined `setup-pnpm` + `setup-bun` for workflows that need both runtimes. | |
| 14 | + |
| 15 | +## Versioning |
| 16 | + |
| 17 | +Pin actions to a tag or commit SHA when you need stability: |
| 18 | + |
| 19 | +```yml |
| 20 | +uses: variableland/gh-actions/actions/<action-name>@<tag-or-sha> |
| 21 | +``` |
| 22 | +
|
| 23 | +`@main` tracks the latest changes on the default branch. |
| 24 | + |
| 25 | +## Node action convention |
| 26 | + |
| 27 | +Every Node-based action in this monorepo follows the same shape: |
| 28 | + |
| 29 | +1. **`action.yml`** declares `runs.using: node24` and `main: dist/index.js`. |
| 30 | +2. **Source** lives in `src/`. The bundled output (`dist/index.js`) is committed to the repo and runs directly on the GitHub Actions runner — no Docker build, no install at runtime. |
| 31 | +3. **`mise.toml`** declares a `build` task that runs `ncc build src/index.ts -o dist`. Mise's incremental `sources`/`outputs` tracking skips the rebuild when nothing has changed. |
| 32 | +4. The **lefthook `pre-push` hook** runs `mise run build` for any push that touches `actions/*/src/**` and blocks the push if `dist/` is out of sync with `src/`. |
| 33 | +5. The CI workflow **`Check actions dist sync`** enforces the same invariant on every PR and is required by branch protection. Anyone who bypasses the local hook still gets caught here. |
| 34 | + |
| 35 | +To add a new Node action, copy the structure of `monorepo-preview-release` or `railway-redeploy`, adjust inputs and logic, and run `mise run build` (or just `git push` — the hook will do it for you and tell you to commit the dist change). |
0 commit comments