| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Deploys a helm chart using GitHub actions. Supports canary deployments and provides a built in helm chart for apps that listen over http to get your ramped up quickly.
View an example repository using this action at github.com/deliverybot/example-helm.
Inputs below are additionally loaded from the payload of the deployment event payload if the action was triggered by a deployment.
Additional parameters: If the action is being triggered by a deployment event and the task parameter in the deployment event is set to "remove" then this action will execute a helm delete $service
The following syntax allows variables to be used in value files:
# .github/workflows/deploy.yml
name: Deploy
on: ['deployment']
jobs:
deployment:
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v1
- name: 'Deploy'
uses: 'deliverybot/helm@v1'
with:
release: 'nginx'
namespace: 'default'
chart: 'app'
token: '${{ github.token }}'
values: |
name: foobar
value-files: >-
[
"values.yaml",
"values.production.yaml"
]
env:
KUBECONFIG_FILE: '${{ secrets.KUBECONFIG }}'If a track is chosen that is equal to canary, this updates the helm chart in a few ways:
Not enabling the service or ingress allows the stable ingress and service resources to pick up the canary pods and route traffic to them.
# .github/workflows/deploy.yml
name: Deploy
on: ['deployment']
jobs:
deployment:
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v1
- name: 'Deploy'
uses: 'deliverybot/helm@v1'
with:
release: 'nginx'
track: canary
namespace: 'default'
chart: 'app'
token: '${{ github.token }}'
values: |
name: foobar
env:
KUBECONFIG_FILE: '${{ secrets.KUBECONFIG }}'If you are creating an environment per pull request with Helm you may have the issue where pull request environments like pr123 sit around in your cluster. By using GitHub actions we can clean those up by listening for pull request close events.
# .github/workflows/pr-cleanup.yml
name: PRCleanup
on:
pull_request:
types: [closed]
jobs:
deployment:
runs-on: 'ubuntu-latest'
steps:
- name: 'Deploy'
uses: 'deliverybot/helm@v1'
with:
# Task remove means to remove the helm release.
task: 'remove'
release: 'review-myapp-${{ github.event.pull_request.number }}'
version: '${{ github.sha }}'
track: 'stable'
chart: 'app'
namespace: 'example-helm'
token: '${{ github.token }}'
env:
KUBECONFIG_FILE: '${{ secrets.KUBECONFIG }}'Sometime you may want to add a custom repository, like chartmuseum. For th
# .github/workflows/pr-cleanup.yml
name: PRCleanup
on:
pull_request:
types: [closed]
jobs:
deployment:
runs-on: 'ubuntu-latest'
steps:
- name: 'Deploy'
uses: 'deliverybot/helm@v1'
with:
release: 'nginx'
namespace: 'default'
chart: 'chartmuseum/app'
token: '${{ github.token }}'
repo: 'http://chartmuseum.example.com'
repo-alias: chartmuseum
repo-username: ${{ secrets.CHARTMUSEUM_USERNAME }}
repo-password: ${{ secrets.CHARTMUSEUM_PASSWORD }}
env:
KUBECONFIG_FILE: '${{ secrets.KUBECONFIG }}'| Back | FazBrowse Home | New Git URL |