Complete guide for using git-flow reusable workflows in your projects.
- Getting Started
- Docker Workflows
- Security Workflows
- Kubernetes Workflows
- Infrastructure Workflows
- GitOps Workflows
- Git Workflows
- Composite Actions
- Best Practices
- Troubleshooting
Required:
- GitHub repository with Actions enabled
- Dockerfile in your repository (for Docker workflows)
Recommended:
- GitHub Container Registry access (ghcr.io)
- Repository secrets configured
- Renovate bot installed
- Create
.github/workflows/directory in your repository - Create a workflow file (e.g.,
ci.yml) - Reference git-flow workflows using
uses:
name: CI Pipeline
on:
push:
branches: [main]
pull_request:
jobs:
build:
uses: samuelho-dev/git-flow/.github/workflows/docker-build-push.yml@v1
with:
image: my-app
secrets: inheritBuild, scan, sign, and push Docker images with comprehensive security features.
| Input | Type | Default | Description |
|---|---|---|---|
context |
string | . |
Build context path |
dockerfile |
string | ./Dockerfile |
Path to Dockerfile |
image |
string | required | Image name (without registry/tag) |
registry |
string | ghcr.io |
Container registry URL |
platforms |
string | linux/amd64 |
Target platforms (comma-separated) |
push |
boolean | true |
Push image to registry |
scan |
boolean | true |
Run Trivy vulnerability scan |
sign |
boolean | true |
Sign image with Cosign |
sbom |
boolean | true |
Generate SBOM |
cache-registry |
boolean | true |
Use registry cache for faster builds |
build-args |
string | '' |
Build arguments (KEY=VALUE, one per line) |
severity |
string | HIGH,CRITICAL |
Minimum vulnerability severity to report |
| Secret | Required | Description |
|---|---|---|
registry-username |
No | Registry username (defaults to github.actor) |
registry-password |
No | Registry password (defaults to GITHUB_TOKEN) |
| Output | Description |
|---|---|
digest |
Image digest (sha256:...) |
tags |
Image tags (newline-separated) |
sbom-path |
Path to SBOM artifact |
name: Build and Deploy
on:
push:
branches: [main, develop]
pull_request:
permissions:
contents: read
packages: write
id-token: write
security-events: write
jobs:
build-backend:
name: Build Backend Image
uses: samuelho-dev/git-flow/.github/workflows/docker-build-push.yml@v1
with:
context: .
dockerfile: ./docker/backend/Dockerfile
image: my-app-backend
registry: ghcr.io
platforms: linux/amd64,linux/arm64
scan: true
sign: true
sbom: true
cache-registry: true
build-args: |
NODE_ENV=production
APP_VERSION=${{ github.sha }}
severity: HIGH,CRITICAL
secrets:
registry-username: ${{ github.actor }}
registry-password: ${{ secrets.GITHUB_TOKEN }}
build-frontend:
name: Build Frontend Image
uses: samuelho-dev/git-flow/.github/workflows/docker-build-push.yml@v1
with:
dockerfile: ./docker/frontend/Dockerfile
image: my-app-frontend
platforms: linux/amd64
scan: true
sign: false # Skip signing for frontend
sbom: true
secrets: inherit # Inherit all secretsMulti-platform builds:
platforms: linux/amd64,linux/arm64,linux/arm/v7Custom build arguments:
build-args: |
NODE_VERSION=20
PNPM_VERSION=8
BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')Private registry:
registry: my-registry.com
secrets:
registry-username: ${{ secrets.REGISTRY_USER }}
registry-password: ${{ secrets.REGISTRY_TOKEN }}Skip features:
scan: false # Skip vulnerability scanning
sign: false # Skip image signing
sbom: false # Skip SBOM generationComprehensive vulnerability scanning for filesystems, images, repositories, and configurations.
| Input | Type | Default | Description |
|---|---|---|---|
scan-type |
string | fs |
Type of scan (fs, image, repo, config, sbom) |
scan-ref |
string | . |
Target to scan |
severity |
string | HIGH,CRITICAL |
Severity levels to report |
format |
string | sarif |
Output format (sarif, json, table) |
exit-code |
string | 1 |
Exit code when vulnerabilities found |
upload-sarif |
boolean | true |
Upload results to GitHub Security |
skip-files |
string | '' |
Files to skip (comma-separated) |
skip-dirs |
string | node_modules,dist,build,.git |
Directories to skip |
timeout |
string | 10m |
Scan timeout duration |
Scan filesystem:
jobs:
scan-code:
uses: samuelho-dev/git-flow/.github/workflows/trivy-scan.yml@v1
with:
scan-type: fs
scan-ref: .
severity: HIGH,CRITICAL
skip-dirs: node_modules,dist,.gitScan Docker image:
jobs:
scan-image:
uses: samuelho-dev/git-flow/.github/workflows/trivy-scan.yml@v1
with:
scan-type: image
scan-ref: ghcr.io/samuelho-dev/my-app:latest
severity: CRITICALScan Kubernetes manifests:
jobs:
scan-k8s:
uses: samuelho-dev/git-flow/.github/workflows/trivy-scan.yml@v1
with:
scan-type: config
scan-ref: deploy/kubernetes/
format: tableSecret detection and prevention with 160+ secret patterns.
| Input | Type | Default | Description |
|---|---|---|---|
scan-path |
string | . |
Path to scan for secrets |
config-path |
string | '' |
Path to gitleaks config file |
format |
string | sarif |
Output format (sarif, json, csv) |
fail-on-findings |
boolean | true |
Fail workflow if secrets found |
upload-sarif |
boolean | true |
Upload results to GitHub Security |
baseline-path |
string | '' |
Path to baseline file (ignore known findings) |
log-level |
string | info |
Log level (debug, info, warn, error) |
Basic secret scan:
jobs:
scan-secrets:
uses: samuelho-dev/git-flow/.github/workflows/gitleaks-scan.yml@v1
with:
fail-on-findings: trueWith custom config:
jobs:
scan-secrets:
uses: samuelho-dev/git-flow/.github/workflows/gitleaks-scan.yml@v1
with:
config-path: .gitleaks.toml
baseline-path: .gitleaks-baseline.json
log-level: debugScan specific path:
jobs:
scan-src:
uses: samuelho-dev/git-flow/.github/workflows/gitleaks-scan.yml@v1
with:
scan-path: src/
fail-on-findings: false # Report onlyGenerate Software Bill of Materials (SBOM) for supply chain security.
| Input | Type | Default | Description |
|---|---|---|---|
target-type |
string | directory |
Target type (image, directory, file) |
target |
string | . |
Target to scan |
format |
string | spdx-json |
SBOM format (spdx-json, cyclonedx-json) |
output-file |
string | sbom.spdx.json |
Output file name |
upload-artifact |
boolean | true |
Upload SBOM as artifact |
upload-dependency-snapshot |
boolean | true |
Upload to GitHub Dependency Graph |
scan-sbom |
boolean | true |
Scan SBOM for vulnerabilities |
Generate SBOM for directory:
jobs:
sbom:
uses: samuelho-dev/git-flow/.github/workflows/sbom-generate.yml@v1
with:
target-type: directory
target: .
format: spdx-jsonGenerate SBOM for Docker image:
jobs:
sbom:
uses: samuelho-dev/git-flow/.github/workflows/sbom-generate.yml@v1
with:
target-type: image
target: ghcr.io/samuelho-dev/my-app:latest
scan-sbom: trueCycloneDX format:
jobs:
sbom:
uses: samuelho-dev/git-flow/.github/workflows/sbom-generate.yml@v1
with:
format: cyclonedx-json
output-file: sbom.cdx.jsonLint and validate Helm charts with kubeconform and helm-docs verification.
| Input | Type | Default | Description |
|---|---|---|---|
chart-path |
string | required | Path to Helm chart directory |
values-file |
string | values.yaml |
Override values file |
strict |
boolean | true |
Use strict linting (fail on warnings) |
kubeconform |
boolean | true |
Run kubeconform validation |
kubernetes-version |
string | 1.30.0 |
Kubernetes version for kubeconform |
helm-docs-check |
boolean | true |
Check if README.md is up to date |
extra-values |
string | '' |
Additional values files (comma-separated) |
schema-validation |
boolean | false |
Validate against JSON schemas |
| Output | Description |
|---|---|
lint-result |
Lint result (success/failure) |
chart-version |
Chart version from Chart.yaml |
Basic Helm lint:
jobs:
lint:
uses: samuelho-dev/git-flow/.github/workflows/helm-lint.yml@v1
with:
chart-path: charts/my-appLint with schema validation:
jobs:
lint:
uses: samuelho-dev/git-flow/.github/workflows/helm-lint.yml@v1
with:
chart-path: charts/my-app
schema-validation: true
extra-values: values-dev.yaml,values-prod.yamlDisable kubeconform:
jobs:
lint:
uses: samuelho-dev/git-flow/.github/workflows/helm-lint.yml@v1
with:
chart-path: charts/my-app
kubeconform: false
strict: false # Allow warningsRun Helm unittest tests for chart validation.
| Input | Type | Default | Description |
|---|---|---|---|
chart-path |
string | required | Path to Helm chart directory |
test-pattern |
string | tests/*.yaml |
Test file pattern (glob) |
fail-fast |
boolean | false |
Stop testing on first failure |
parallel |
boolean | true |
Run tests in parallel |
output-format |
string | junit |
Test output format (normal, junit, nunit) |
strict |
boolean | true |
Fail on warnings |
update-snapshots |
boolean | false |
Update test snapshots |
| Output | Description |
|---|---|
test-result |
Test result (success/failure) |
tests-run |
Number of tests executed |
tests-passed |
Number of tests passed |
tests-failed |
Number of tests failed |
Basic Helm test:
jobs:
test:
uses: samuelho-dev/git-flow/.github/workflows/helm-test.yml@v1
with:
chart-path: charts/my-appTest with snapshot update:
jobs:
test:
uses: samuelho-dev/git-flow/.github/workflows/helm-test.yml@v1
with:
chart-path: charts/my-app
update-snapshots: true
output-format: junitCustom test pattern:
jobs:
test:
uses: samuelho-dev/git-flow/.github/workflows/helm-test.yml@v1
with:
chart-path: charts/my-app
test-pattern: tests/**/*_test.yaml
fail-fast: truePackage and publish Helm charts to OCI registries with signing.
| Input | Type | Default | Description |
|---|---|---|---|
chart-path |
string | required | Path to Helm chart directory |
registry |
string | ghcr.io |
OCI registry URL |
repository |
string | {owner}/charts |
Chart repository path |
sign-chart |
boolean | true |
Sign chart with Cosign |
create-release |
boolean | true |
Create GitHub release |
multi-registry |
string | '' |
Additional registries (comma-separated) |
update-index |
boolean | false |
Update Helm repository index |
provenance |
boolean | true |
Generate chart provenance file |
| Secret | Required | Description |
|---|---|---|
registry-username |
No | Registry username (defaults to github.actor) |
registry-password |
No | Registry password (defaults to GITHUB_TOKEN) |
gpg-private-key |
No | GPG private key for chart signing |
gpg-passphrase |
No | GPG key passphrase |
| Output | Description |
|---|---|
chart-version |
Published chart version |
chart-digest |
OCI digest of published chart |
release-url |
GitHub release URL |
Basic Helm publish:
jobs:
publish:
uses: samuelho-dev/git-flow/.github/workflows/helm-publish.yml@v1
with:
chart-path: charts/my-app
secrets: inheritPublish to multiple registries:
jobs:
publish:
uses: samuelho-dev/git-flow/.github/workflows/helm-publish.yml@v1
with:
chart-path: charts/my-app
multi-registry: docker.io,quay.io
sign-chart: true
secrets: inheritPublish without GitHub release:
jobs:
publish:
uses: samuelho-dev/git-flow/.github/workflows/helm-publish.yml@v1
with:
chart-path: charts/my-app
create-release: false
provenance: falseTest Kyverno policies using Kyverno CLI and Chainsaw framework.
| Input | Type | Default | Description |
|---|---|---|---|
policy-path |
string | required | Path to Kyverno policies directory |
test-path |
string | tests |
Path to Chainsaw tests directory |
kyverno-version |
string | v1.13.0 |
Kyverno CLI version |
chainsaw-version |
string | v0.2.14 |
Chainsaw version |
test-framework |
string | both |
Test framework (chainsaw, kyverno-cli, both) |
fail-fast |
boolean | false |
Stop testing on first failure |
report-format |
string | junit |
Report format (json, junit, none) |
validate-policies |
boolean | true |
Validate policy syntax before testing |
| Output | Description |
|---|---|
test-result |
Test result (success/failure) |
tests-run |
Number of tests executed |
tests-passed |
Number of tests passed |
tests-failed |
Number of tests failed |
Basic Kyverno test:
jobs:
test:
uses: samuelho-dev/git-flow/.github/workflows/kyverno-test.yml@v1
with:
policy-path: policies/Test with Chainsaw only:
jobs:
test:
uses: samuelho-dev/git-flow/.github/workflows/kyverno-test.yml@v1
with:
policy-path: policies/
test-path: tests/chainsaw
test-framework: chainsaw
fail-fast: trueTest with specific versions:
jobs:
test:
uses: samuelho-dev/git-flow/.github/workflows/kyverno-test.yml@v1
with:
policy-path: policies/
kyverno-version: v1.13.0
chainsaw-version: v0.2.14
report-format: junitValidate Terraform configuration with formatting checks and security scanning.
| Input | Type | Default | Description |
|---|---|---|---|
terraform-path |
string | required | Path to Terraform directory |
terraform-version |
string | 1.9.8 |
Terraform version |
format-check |
boolean | true |
Check Terraform formatting |
tfsec-scan |
boolean | true |
Run tfsec security scan |
checkov-scan |
boolean | true |
Run Checkov compliance scan |
terraform-docs-check |
boolean | false |
Check if README.md is up to date |
upload-sarif |
boolean | true |
Upload security results to GitHub Security |
working-directory |
string | . |
Working directory for commands |
| Output | Description |
|---|---|
validation-result |
Validation result (success/failure) |
format-result |
Format check result |
security-findings |
Number of security findings |
Basic Terraform validation:
jobs:
validate:
uses: samuelho-dev/git-flow/.github/workflows/terraform-validate.yml@v1
with:
terraform-path: terraform/environments/prodFull validation with docs check:
jobs:
validate:
uses: samuelho-dev/git-flow/.github/workflows/terraform-validate.yml@v1
with:
terraform-path: terraform/environments/prod
format-check: true
tfsec-scan: true
checkov-scan: true
terraform-docs-check: trueGenerate Terraform plan with cost estimation and PR comments.
| Input | Type | Default | Description |
|---|---|---|---|
terraform-path |
string | required | Path to Terraform directory |
terraform-version |
string | 1.9.8 |
Terraform version |
plan-args |
string | '' |
Additional arguments for terraform plan |
var-file |
string | '' |
Path to tfvars file (relative to terraform-path) |
working-directory |
string | . |
Working directory for commands |
comment-pr |
boolean | true |
Comment plan output on PR |
cost-estimation |
boolean | false |
Run Infracost for cost estimation |
upload-plan |
boolean | true |
Upload plan file as artifact |
| Secret | Required | Description |
|---|---|---|
terraform-token |
No | Terraform Cloud/Enterprise API token |
aws-access-key-id |
No | AWS Access Key ID (if using AWS) |
aws-secret-access-key |
No | AWS Secret Access Key (if using AWS) |
infracost-api-key |
No | Infracost API key for cost estimation |
| Output | Description |
|---|---|
plan-result |
Plan result (success/failure) |
resources-to-add |
Number of resources to add |
resources-to-change |
Number of resources to change |
resources-to-destroy |
Number of resources to destroy |
Basic Terraform plan:
jobs:
plan:
uses: samuelho-dev/git-flow/.github/workflows/terraform-plan.yml@v1
with:
terraform-path: terraform/environments/prod
secrets: inheritPlan with cost estimation:
jobs:
plan:
uses: samuelho-dev/git-flow/.github/workflows/terraform-plan.yml@v1
with:
terraform-path: terraform/environments/prod
cost-estimation: true
var-file: prod.tfvars
secrets:
terraform-token: ${{ secrets.TF_API_TOKEN }}
infracost-api-key: ${{ secrets.INFRACOST_API_KEY }}Plan with AWS credentials:
jobs:
plan:
uses: samuelho-dev/git-flow/.github/workflows/terraform-plan.yml@v1
with:
terraform-path: terraform/aws
comment-pr: true
secrets:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}Apply Terraform changes with state backup and approval gates.
| Input | Type | Default | Description |
|---|---|---|---|
terraform-path |
string | required | Path to Terraform directory |
terraform-version |
string | 1.9.8 |
Terraform version |
plan-artifact-name |
string | '' |
Name of plan artifact to apply |
apply-args |
string | '' |
Additional arguments for terraform apply |
working-directory |
string | . |
Working directory for commands |
environment |
string | '' |
GitHub environment for approval |
backup-state |
boolean | true |
Backup state file before apply |
skip-plan |
boolean | false |
Skip plan validation (NOT RECOMMENDED) |
| Secret | Required | Description |
|---|---|---|
terraform-token |
No | Terraform Cloud/Enterprise API token |
aws-access-key-id |
No | AWS Access Key ID (if using AWS) |
aws-secret-access-key |
No | AWS Secret Access Key (if using AWS) |
| Output | Description |
|---|---|
apply-result |
Apply result (success/failure) |
resources-applied |
Number of resources applied |
Apply with plan artifact:
jobs:
plan:
uses: samuelho-dev/git-flow/.github/workflows/terraform-plan.yml@v1
with:
terraform-path: terraform/environments/prod
apply:
needs: plan
uses: samuelho-dev/git-flow/.github/workflows/terraform-apply.yml@v1
with:
terraform-path: terraform/environments/prod
plan-artifact-name: terraform-plan-${{ github.sha }}
environment: production
secrets: inheritApply with environment approval:
jobs:
apply:
uses: samuelho-dev/git-flow/.github/workflows/terraform-apply.yml@v1
with:
terraform-path: terraform/environments/prod
environment: production # Requires GitHub Environment approval
backup-state: true
secrets: inheritUpdate Kubernetes manifests with new image tags or Helm values.
| Input | Type | Default | Description |
|---|---|---|---|
manifest-path |
string | required | Path to manifests directory |
update-type |
string | image |
Update type (image, helm-values, kustomize) |
image-name |
string | '' |
Image name to update (for image type) |
image-tag |
string | '' |
New image tag |
file-pattern |
string | **/*.yaml |
File pattern to update (glob) |
helm-key |
string | '' |
Helm value key path (e.g., image.tag) |
helm-value |
string | '' |
Helm value to set |
commit-message |
string | '' |
Git commit message |
create-pr |
boolean | false |
Create pull request instead of direct commit |
pr-branch |
string | gitops/auto-update |
Branch name for PR |
target-branch |
string | main |
Target branch for updates |
| Output | Description |
|---|---|
update-result |
Update result (success/failure) |
files-updated |
Number of files updated |
pr-url |
Pull request URL (if created) |
Update image tag:
jobs:
update:
uses: samuelho-dev/git-flow/.github/workflows/gitops-update-manifests.yml@v1
with:
manifest-path: k8s/apps/my-app
update-type: image
image-name: ghcr.io/owner/my-app
image-tag: v1.2.3Update with PR creation:
jobs:
update:
uses: samuelho-dev/git-flow/.github/workflows/gitops-update-manifests.yml@v1
with:
manifest-path: k8s/apps/my-app
update-type: image
image-name: ghcr.io/owner/my-app
image-tag: ${{ github.sha }}
create-pr: true
pr-branch: gitops/update-${{ github.sha }}Update Helm values:
jobs:
update:
uses: samuelho-dev/git-flow/.github/workflows/gitops-update-manifests.yml@v1
with:
manifest-path: helm/my-app
update-type: helm-values
helm-key: image.tag
helm-value: v1.2.3
commit-message: "chore: update image tag to v1.2.3"Trigger ArgoCD application sync with health verification.
| Input | Type | Default | Description |
|---|---|---|---|
argocd-server |
string | required | ArgoCD server URL |
argocd-app-name |
string | required | ArgoCD application name |
argocd-namespace |
string | argocd |
ArgoCD namespace |
sync-strategy |
string | auto |
Sync strategy (auto, apply, hook) |
prune |
boolean | false |
Prune resources during sync |
force |
boolean | false |
Force sync (override diverged state) |
dry-run |
boolean | false |
Perform dry-run sync |
wait-for-sync |
boolean | true |
Wait for sync to complete |
sync-timeout |
number | 300 |
Sync timeout in seconds |
health-check |
boolean | true |
Check application health after sync |
revision |
string | '' |
Target revision (branch, tag, commit) |
| Secret | Required | Description |
|---|---|---|
argocd-token |
Yes | ArgoCD authentication token |
kubeconfig |
No | Kubernetes config (if accessing cluster directly) |
| Output | Description |
|---|---|
sync-result |
Sync result (success/failure) |
sync-status |
Sync status (Synced, OutOfSync, Unknown) |
health-status |
Health status (Healthy, Progressing, Degraded, Suspended) |
Basic ArgoCD sync:
jobs:
sync:
uses: samuelho-dev/git-flow/.github/workflows/argocd-sync.yml@v1
with:
argocd-server: argocd.example.com
argocd-app-name: my-app
secrets:
argocd-token: ${{ secrets.ARGOCD_TOKEN }}Sync with prune and force:
jobs:
sync:
uses: samuelho-dev/git-flow/.github/workflows/argocd-sync.yml@v1
with:
argocd-server: argocd.example.com
argocd-app-name: my-app
prune: true
force: true
wait-for-sync: true
sync-timeout: 600
secrets:
argocd-token: ${{ secrets.ARGOCD_TOKEN }}Dry-run sync:
jobs:
sync-test:
uses: samuelho-dev/git-flow/.github/workflows/argocd-sync.yml@v1
with:
argocd-server: argocd.example.com
argocd-app-name: my-app
dry-run: true
secrets:
argocd-token: ${{ secrets.ARGOCD_TOKEN }}Keep a target branch (e.g. dev) in sync with a source branch (e.g. main). The workflow tries the cleanest merge strategy first and escalates only when needed:
- Fast-forward — no merge commit noise
- Merge commit — when target has diverged
- Open a PR — when there are merge conflicts that require human resolution
| Input | Type | Default | Description |
|---|---|---|---|
source-branch |
string | main |
Branch to sync from |
target-branch |
string | dev |
Branch to sync to |
create-pr-on-conflict |
boolean | true |
Open a PR if merge conflicts prevent automatic sync |
pr-labels |
string | automated,sync |
Comma-separated labels for conflict PRs |
| Secret | Required | Description |
|---|---|---|
token |
No | GitHub token with repo write access (falls back to GITHUB_TOKEN) |
| Output | Description |
|---|---|
result |
Sync result: fast-forward, merged, pr-created, up-to-date, or failed |
pr-number |
PR number if a conflict PR was created |
Basic — sync main to dev on every push:
name: Sync main to dev
on:
push:
branches: [main]
jobs:
sync:
uses: samuelho-dev/git-flow/.github/workflows/sync-main-to-dev.yml@v1
permissions:
contents: write
pull-requests: writeCustom branches:
jobs:
sync:
uses: samuelho-dev/git-flow/.github/workflows/sync-main-to-dev.yml@v1
with:
source-branch: release
target-branch: develop
permissions:
contents: write
pull-requests: writeWith a PAT for protected branches:
jobs:
sync:
uses: samuelho-dev/git-flow/.github/workflows/sync-main-to-dev.yml@v1
permissions:
contents: write
pull-requests: write
secrets:
token: ${{ secrets.SYNC_PAT }}Disable PR creation on conflict:
jobs:
sync:
uses: samuelho-dev/git-flow/.github/workflows/sync-main-to-dev.yml@v1
with:
create-pr-on-conflict: false
permissions:
contents: write
pull-requests: writeAct on the result in a downstream job:
jobs:
sync:
uses: samuelho-dev/git-flow/.github/workflows/sync-main-to-dev.yml@v1
permissions:
contents: write
pull-requests: write
notify:
needs: sync
if: needs.sync.outputs.result == 'pr-created'
runs-on: ubuntu-latest
steps:
- run: echo "Conflict PR #${{ needs.sync.outputs.pr-number }} needs review"Setup Node.js with pnpm and intelligent dependency caching.
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js with pnpm
uses: samuelho-dev/git-flow/actions/setup-node-pnpm@v1
with:
node-version: 20
pnpm-version: 8
cache: true
- name: Build
run: pnpm build
- name: Test
run: pnpm test| Input | Default | Description |
|---|---|---|
node-version |
20 |
Node.js version |
pnpm-version |
8 |
pnpm version |
cache |
true |
Enable caching |
working-directory |
. |
Working directory |
| Output | Description |
|---|---|
cache-hit |
Whether cache was restored |
pnpm-store-path |
pnpm store directory path |
Install kubectl, Helm, ArgoCD CLI, and Cosign.
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Kubernetes tools
uses: samuelho-dev/git-flow/actions/setup-kubernetes-tools@v1
with:
install-kubectl: true
install-helm: true
install-argocd: true
install-cosign: true
kubectl-version: v1.30.0
helm-version: v3.16.3
- name: Deploy with Helm
run: helm upgrade --install my-app ./chart| Input | Default | Description |
|---|---|---|
kubectl-version |
v1.30.0 |
kubectl version |
helm-version |
v3.16.3 |
Helm version |
argocd-version |
v2.10.20 |
ArgoCD CLI version |
cosign-version |
v2.4.1 |
Cosign version |
install-kubectl |
true |
Install kubectl |
install-helm |
true |
Install Helm |
install-argocd |
false |
Install ArgoCD CLI |
install-cosign |
false |
Install Cosign |
Use major version tags for auto-updates:
uses: samuelho-dev/git-flow/.github/workflows/docker-build-push.yml@v1Pin to specific version for stability:
uses: samuelho-dev/git-flow/.github/workflows/docker-build-push.yml@v1.0.0Use commit SHA for maximum security:
uses: samuelho-dev/git-flow/.github/workflows/docker-build-push.yml@abc123def456Use repository secrets:
secrets:
registry-password: ${{ secrets.GITHUB_TOKEN }}Use secrets: inherit when appropriate:
jobs:
build:
uses: samuelho-dev/git-flow/.github/workflows/docker-build-push.yml@v1
secrets: inherit # Pass all secretsGrant minimal required permissions:
permissions:
contents: read # Read repository
packages: write # Push Docker images
id-token: write # Cosign signing
security-events: write # Upload scan resultsUse path filters to skip unnecessary runs:
on:
push:
branches: [main]
paths:
- 'src/**'
- 'Dockerfile'
- '.github/workflows/**'Use concurrency to cancel outdated runs:
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: trueImage push fails:
Error: denied: permission denied
Solution: Ensure packages: write permission is granted and registry credentials are correct.
Trivy scan timeout:
Error: context deadline exceeded
Solution: Increase timeout:
with:
timeout: 15mCache not restoring:
Solution: Check cache key and ensure dependencies haven't changed:
with:
cache-registry: false # Disable registry cache- Issues: GitHub Issues
- Examples: docs/EXAMPLES.md
- Discussions: GitHub Discussions