Skip to content

Production Deploy

Production Deploy #111

name: Production Deploy
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
on:
workflow_dispatch:
jobs:
build:
name: Build All
permissions: write-all
uses: jacobbrewer1/puppet-summary/.github/workflows/ci-docker.yml@main
secrets: inherit
deploy:
name: Deploy Puppet Summary
runs-on: ubuntu-latest
needs: [ build ]
environment: production
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Get commit
id: get_commit
run: echo "sha_short_deploy=$(git rev-parse --short ${{ github.sha }})" >> $GITHUB_OUTPUT
- name: Get GitHubAPI token
id: import-secrets
uses: hashicorp/vault-action@v2
with:
url: ${{ secrets.VAULT_HOST }}
method: userpass
username: ${{ secrets.VAULT_USER }}
password: ${{ secrets.VAULT_PASSWORD }}
secrets: |
${{ secrets.VAULT_GITHUB_PATH }} ${{ secrets.VAULT_GITHUB_KEY }} | GITHUB_TOKEN ;
${{ secrets.VAULT_KUBE_CONFIG_PATH }} ${{ secrets.VAULT_KUBE_CONFIG_KEY }} | KUBE_CONFIG ;
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: main
repository: Jacobbrewer1/supporting-charts
path: ./charts
token: ${{ steps.import-secrets.outputs.GITHUB_TOKEN }}
- name: Deploy Puppet Summary
uses: WyriHaximus/github-action-helm3@v4
with:
exec: helm upgrade --install puppet-summary ./charts --values charts/valueFiles/prod-1/puppet-summary.yaml --set image.tag=${{ steps.get_commit.outputs.sha_short_deploy }}
kubeconfig: '${{ steps.import-secrets.outputs.KUBE_CONFIG }}'