-
Notifications
You must be signed in to change notification settings - Fork 2
46 lines (38 loc) · 1.19 KB
/
portal-dev-deploy.yml
File metadata and controls
46 lines (38 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: Deploy to Production
on:
workflow_dispatch:
inputs:
tag:
type: string
description: The tag to deploy
required: true
env:
KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }}
DOCKER_REGISTRY: your-registry
DOCKER_IMAGE: your-app
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up kubectl
uses: azure/k8s-set-context@v1
with:
kubeconfig: ${{ secrets.DEV_KUBE_CONFIG }}
- name: Install Helm
uses: azure/setup-helm@v3
with:
version: 'v3.12.0'
- name: Update image tag in values file
run: |
sed -i "s/tag: .*/tag: ${{ github.event.inputs.tag }}/" charts/portal/environments/dev.yaml
- name: Commit changes
run: |
git config --global user.name 'GitHub Actions'
git config --global user.email 'github-actions@github.com'
git add charts/portal/environments/dev.yaml
git commit -m "Update image tag to ${{ github.event.inputs.tag }}"
git push
- name: Deploy to dev
run: |
helm upgrade portal portal -n portal -f portal/values.yaml -f portal/environments/dev.yaml