-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (38 loc) · 1.52 KB
/
deployment.yml
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
name: test
on:
workflow_call:
secrets:
KUBECONTENT:
required: true
jobs:
deployment:
if: ${{ startsWith(github.ref, 'refs/heads/deployment/') || github.ref == 'refs/heads/main' }}
runs-on: [self-hosted]
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Get version
id: version
run: |
if [[ -n "$GITHUB_REF" && "$GITHUB_REF" == "refs/tags/"* ]]; then
echo "tag version"
echo "::set-output name=version::${GITHUB_REF/refs\/tags\//}"
else
echo "commit version"
echo "::set-output name=version::${{ github.sha }}"
fi
- name: Set up Helm
run: |
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
- name: RemoveOs
uses: WyriHaximus/github-action-helm3@v3
with:
exec: /usr/local/bin/helm uninstall gitdataos --namespace gitdata
kubeconfig: ${{ secrets.KUBECONTENT }}
overrule_existing_kubeconfig: 'true'
- name: DeployOs
uses: WyriHaximus/github-action-helm3@v3
with:
exec: /usr/local/bin/helm upgrade gitdataos --install ./charts --namespace gitdata
kubeconfig: ${{ secrets.KUBECONTENT }}
overrule_existing_kubeconfig: 'true'