Skip to content
lucasatstoryb edited this page Nov 18, 2022 · 1 revision

CD

The CD workflwos is responsible for deploying code to each environment according to its constraints.

How to use this workflow:

jobs:
  <job_name>:
    name: '<Job name such as Deploy to PROD>'
    uses: signalwire/actions-template/.github/workflows/cd-deploy-swarm.yml@main
    with:
      STACK_NAME: <portainer stack name>
      APPROVERS: <list of individuals or groups>
      IMAGE_TAG: <output from CI meta tag>
    secrets:
      ENDPOINT_ID: ${{ secrets.SONAR_TOKEN }}
      SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
      SONAR_PROJECT_KEY: ${{ secrets.SONAR_PROJECT_KEY }}
      GH_BOT_DEPLOY_KEY: ${{ secrets.GH_BOT_DEPLOY_KEY }}
      GITHUBTOKEN: ${{ secrets.GITHUB_TOKEN }}
      DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
      DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}

Inputs

Name Default Value Type Required Description
STACK_NAME String true The default stack name on Portainer
APPROVERS string false A group or comma-separated list of approvers, if suppressed no approvers will be added
IMAGE_TAG string true A string containing the default image to be updated

Secrets

Name Required Description
ENDPOINT_ID true The default endpoint id on Portainer
PORTAINER_API_KEY true A API to access Portainer to perform operations
GH_APPROVAL_APP_ID false GitHub Approval bot App ID, must be set in case APPROVERS != null
GH_APPROVAL_APP_PKEY false GitHub Approval bot Private Key, must be set in case APPROVERS != null
Clone this wiki locally