Merge pull request #12 from osuAkatsuki/faxus #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Grafana Deployment" | |
on: | |
push: | |
branches: | |
- master | |
env: | |
TEMPO_USER: ${{ secrets.TEMPO_USER }} | |
PROMETHEUS_USER: ${{ secrets.PROMETHEUS_USER }} | |
GRAFANA_USER: ${{ secrets.GRAFANA_USER }} | |
GRAFANA_SECRET: ${{ secrets.GRAFANA_SECRET }} | |
DB_USER: ${{ secrets.DB_USER }} | |
DB_PASSWORD: ${{ secrets.DB_PASSWORD }} | |
DB_HOST: ${{ secrets.DB_HOST }} | |
DB_PORT: ${{ secrets.DB_PORT }} | |
DB_SCHEMA: ${{ secrets.DB_SCHEMA }} | |
REDIS_HOST: ${{ secrets.REDIS_HOST }} | |
REDIS_PORT: ${{ secrets.REDIS_PORT }} | |
jobs: | |
production-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out latest commit | |
uses: actions/checkout@v3 | |
- name: Get kubeconfig from github secrets | |
run: | | |
mkdir -p $HOME/.kube | |
echo "${{ secrets.KUBECONFIG }}" > $HOME/.kube/config | |
sudo chown $(id -u):$(id -g) $HOME/.kube/config | |
chmod 600 $HOME/.kube/config | |
- name: Install helm | |
uses: azure/setup-helm@v3 | |
with: | |
version: "latest" | |
id: install | |
- name: Install helm-diff | |
run: helm plugin install https://github.com/databus23/helm-diff | |
- name: Add Grafana Helm Charts Repository | |
run: | | |
helm repo add grafana https://grafana.github.io/helm-charts | |
helm repo update | |
- name: Generate helm values for alloy and k8s-monitor | |
run: | | |
envsubst < k8s/grafana-alloy.yaml > alloy-values.yaml | |
envsubst < k8s/grafana-k8s-monitor.yaml > k8s-monitoring-values.yaml | |
- name: Show manifest diff since previous alloy release | |
run: | | |
helm diff upgrade \ | |
--allow-unreleased \ | |
--color=true \ | |
--values alloy-values.yaml \ | |
grafana-alloy \ | |
grafana/alloy | |
- name: Show manifest diff since previous k8s-monitor release | |
run: | | |
helm diff upgrade \ | |
--version ^1 \ | |
--allow-unreleased \ | |
--color=true \ | |
--values k8s-monitoring-values.yaml \ | |
grafana-k8s-monitoring \ | |
grafana/k8s-monitoring | |
- name: Deploy Alloy to production cluster | |
run: | | |
helm upgrade \ | |
--install \ | |
--atomic \ | |
--wait --timeout 10m \ | |
--cleanup-on-fail \ | |
--values alloy-values.yaml \ | |
grafana-alloy \ | |
grafana/alloy | |
- name: Deploy k8s-monitor to production cluster | |
run: | | |
helm upgrade \ | |
--install \ | |
--version ^1 \ | |
--atomic \ | |
--wait --timeout 300s \ | |
--values k8s-monitoring-values.yaml \ | |
grafana-k8s-monitoring \ | |
grafana/k8s-monitoring |