Skip to content

Latest commit

 

History

History
272 lines (207 loc) · 11.6 KB

File metadata and controls

272 lines (207 loc) · 11.6 KB

Icon GitHub Action: Deploy - ArgoCD Manifest Files

Deploy - ArgoCD Manifest Files

Marketplace Release License Stars PRs Welcome

Overview

Prepares the ArgoCD manifest files for deployment. Fills in the required fields and updates the Helm chart values. This action is used to deploy an application using ArgoCD. It updates the application manifest with the provided values and deploys it to the specified namespace.

Updated Helm chart values

  1. Common updates:
  • All values provided in the chart-values input are injected into the Helm chart at their specified YAML paths. Each entry must include a path (YAML key) and a value.
  • The deployment ID is automatically added to the chart values as .deploymentId, allowing the chart to reference the current deployment instance.
  • The step validates that each chart value entry contains both path and value properties, ensuring correct input structure.
  1. Vendor-specific updates for the chart version and other properties:
  • Updates the tags.datadoghq.com/version key to the chart version in Helm values.

Files/paths updated by this action

  1. The ArgoCD application manifest file (input application-file) is updated with:
  • Metadata:
    • Name: set to the target namespace
    • Annotations:
      • "argocd.argoproj.io/application-repository": set to the application repository
      • "argocd.argoproj.io/deployment-id": set to the deployment ID
  • Spec:
    • Destination:
      • Namespace: set to the target namespace
    • Source or Sources: supports both singular source and multiple sources array formats
      • Chart/RepoURL: validated against the provided chart-name and chart-repository inputs; the action fails if they do not match the manifest contents
      • TargetRevision: set to the Helm chart version
      • Source Selection: when multiple sources entries exist, only the entry (or entries) whose chart and repoURL match the provided inputs is updated; the action fails if no entry matches
      • Plugin - hoverkraft-deployment (if exists in source or any sources[]):
        • Environment variable HOVERKRAFT_DEPLOYMENT_ID: updated with the deployment ID to trigger sync detection
      • Helm Values:
        • Chart values: custom values provided via the chart-values input, allowing dynamic configuration of the Helm chart (e.g., application URIs, feature flags).
        • Deployment ID: injected as a value to identify the deployment instance within the chart values.
        • Vendor-specific values: additional values set for integrations, such as updating tags.datadoghq.com/version for Datadog monitoring/versioning.

Example with singular source format:

metadata:
  name: my-namespace
  annotations:
    argocd.argoproj.io/application-repository: https://github.com/my-org/my-app
    argocd.argoproj.io/deployment-id: deploy-1234
spec:
  destination:
    namespace: my-namespace
  source:
    chart: my-chart
    repoURL: https://charts.example.com
    targetRevision: 1.2.3
    # If using ArgoCD plugin (optional):
    plugin:
      name: hoverkraft-deployment
      env:
        - name: HOVERKRAFT_DEPLOYMENT_ID
          value: deploy-1234
    helm:
      values:
        application:
          appUri: https://my-app-review-app-1234.my-org.com
        deploymentId: deploy-1234
        tags:
          datadoghq.com:
            version: 1.2.3

Example with multiple sources array format:

metadata:
  name: my-namespace
  annotations:
    argocd.argoproj.io/application-repository: https://github.com/my-org/my-app
    argocd.argoproj.io/deployment-id: deploy-1234
spec:
  destination:
    namespace: my-namespace
  sources:
    - chart: my-chart
      repoURL: https://charts.example.com
      targetRevision: 1.2.3
      # If using ArgoCD plugin (optional):
      plugin:
        name: hoverkraft-deployment
        env:
          - name: HOVERKRAFT_DEPLOYMENT_ID
            value: deploy-1234
      helm:
        values:
          application:
            appUri: https://my-app-review-app-1234.my-org.com
          deploymentId: deploy-1234
          tags:
            datadoghq.com:
              version: 1.2.3
  1. The extra manifest file (input manifest-file) is updated with:
  • Metadata:
    • Name: set to the target namespace (if the metadata.name field exists)
    • Annotations:
      • "app.kubernetes.io/instance": set to the target namespace (if the annotation exists)
    • Namespace: set to the target namespace (if the metadata.namespace field exists)

Example:

metadata:
  name: my-namespace
  annotations:
    app.kubernetes.io/instance: my-namespace

Usage

- uses: hoverkraft-tech/ci-github-publish/actions/deploy/argocd-manifest-files@2c8e24b416226074aea1e240468f043edefc5760 # 0.23.2
  with:
    # Deployment ID to be used in the ArgoCD application manifest
    # This input is required.
    deployment-id: ""

    # Namespace to deploy the application
    # This input is required.
    namespace: ""

    # Name of the Helm chart
    # This input is required.
    chart-name: ""

    # Repository URL of the Helm chart
    # This input is required.
    chart-repository: ""

    # Version of the Helm chart
    # This input is required.
    chart-version: ""

    # Values to be replaced in the chart.
    # Example:
    # ```json
    # [
    # { "path": "application.appUri", "value": "https://my-app-review-app-1234.my-org.com" }
    # ]
    # ```
    chart-values: ""

    # Repository of the application
    # This input is required.
    application-repository: ""

    # Path to the application manifest file
    # This input is required.
    application-file: ""

    # Path to the extra manifest file
    # This input is required.
    manifest-file: ""

    # Username to record as having initiated the sync operation
    # This input is required.
    initiated-by: ""

Inputs

Input Description Required Default
deployment-id Deployment ID to be used in the ArgoCD application manifest true -
namespace Namespace to deploy the application true -
chart-name Name of the Helm chart true -
chart-repository Repository URL of the Helm chart true -
chart-version Version of the Helm chart true -
chart-values Values to be replaced in the chart. false -
Example:
[
 { "path": "application.appUri", "value": "https://my-app-review-app-1234.my-org.com" }
]
application-repository Repository of the application true -
application-file Path to the application manifest file true -
manifest-file Path to the extra manifest file true -
initiated-by Username to record as having initiated the sync operation true -

Contributing

Contributions are welcome! Please see the contributing guidelines for more details.

License

This project is licensed under the MIT License.

SPDX-License-Identifier: MIT

Copyright © 2026 Hoverkraft

For more details, see the license.


This documentation was automatically generated by CI Dokumentor.