Reduced input variables
This commit is contained in:
41
README.md
41
README.md
@@ -11,7 +11,6 @@ Table of Contents
|
||||
- [Installation](#installation)
|
||||
- [Usage](#usage)
|
||||
- [Deploy](#deploy)
|
||||
- [Slug](#slug)
|
||||
- [Cleanup](#cleanup)
|
||||
- [Roadmap](#roadmap)
|
||||
|
||||
@@ -72,65 +71,39 @@ See `examples/deploy.yml` for a complete workflow covering production, preview,
|
||||
|
||||
### Deploy
|
||||
|
||||
Builds the Docker image, starts the container, and registers a Pangolin resource.
|
||||
Builds the Docker image, starts the container, and registers a Pangolin resource. The branch name drives everything else: pushes to the repo's default branch deploy as `production`, all other branches deploy as previews with a slugified tag, a deterministic host port, and a `${slug}.${app-name}` subdomain.
|
||||
|
||||
- uses: https://git.zyrrus.dev/eighty-six/node-deploy-action/deploy@v1
|
||||
with:
|
||||
app-name: my-app
|
||||
tag: production
|
||||
port: "3001"
|
||||
environment: production
|
||||
subdomain: my-app
|
||||
branch: ${{ github.ref_name }}
|
||||
|
||||
Inputs
|
||||
|
||||
`app-name`
|
||||
|
||||
Application name (used for image/container naming)
|
||||
Application name (used for image/container naming, and as the production subdomain)
|
||||
|
||||
`tag`
|
||||
`branch`
|
||||
|
||||
Image/container tag (e.g. `production` or a branch slug)
|
||||
|
||||
`port`
|
||||
|
||||
Host port to expose
|
||||
Branch name. Matches against `github.event.repository.default_branch` to decide production vs. preview. `refs/heads/` prefix is stripped.
|
||||
|
||||
`internal-port`
|
||||
|
||||
Port the app listens on inside the container (default `3000`)
|
||||
|
||||
`environment`
|
||||
|
||||
`production` or `preview`
|
||||
|
||||
`subdomain`
|
||||
|
||||
Subdomain for the Pangolin resource
|
||||
|
||||
`build-args`
|
||||
|
||||
Extra `KEY=VALUE` docker build args (space-separated)
|
||||
|
||||
### Slug
|
||||
|
||||
Derives a URL-safe slug and a deterministic port from a branch name. Strips `refs/heads/` so either `github.ref_name` or `github.event.ref` works.
|
||||
|
||||
- id: slug
|
||||
uses: https://git.zyrrus.dev/eighty-six/node-deploy-action/slug@v1
|
||||
with:
|
||||
branch: ${{ github.ref_name }}
|
||||
|
||||
Outputs: `slug`, `port`.
|
||||
|
||||
### Cleanup
|
||||
|
||||
Stops the preview container and removes its Pangolin resource. Intended for `delete` branch events.
|
||||
Stops the preview container and removes its Pangolin resource. Intended for `delete` branch events — the slug is derived from the branch name internally.
|
||||
|
||||
- uses: https://git.zyrrus.dev/eighty-six/node-deploy-action/cleanup@v1
|
||||
with:
|
||||
app-name: my-app
|
||||
slug: ${{ steps.slug.outputs.slug }}
|
||||
branch: ${{ github.event.ref }}
|
||||
|
||||
## Roadmap
|
||||
|
||||
|
||||
Reference in New Issue
Block a user