-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (84 loc) · 2.44 KB
/
deploy-v3-tpl.yaml
File metadata and controls
84 lines (84 loc) · 2.44 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# deploy to kubernetes workflow
name: Deploy to Kubernetes
on:
workflow_call:
inputs:
version:
description: "Kubectl version"
default: "latest"
required: false
type: string
cluster:
description: "Kubernetes cluster"
required: true
type: string
namespace:
description: "Kubernetes cluster namespace"
required: true
type: string
images:
description: "The image name"
required: true
type: string
tag:
description: "The image tag"
required: true
type: string
releaseName:
description: "The release name"
required: true
type: string
dir:
required: false
type: string
revision:
description: "Revsion"
required: true
type: string
auto-sync:
description: auto sync
required: false
type: boolean
default: true
argocd-server:
description: default server
required: false
type: string
default: argocd.naturalselectionlabs.com:443
secrets:
ARGOCD_TOKEN:
required: true
env:
ARGOCD_SERVER: ${{ inputs.argocd-server }}
ARGOCD_AUTH_TOKEN: ${{ secrets.ARGOCD_TOKEN }}
ARGOCD_OPTS: "--grpc-web"
APP_NAME: ${{ inputs.releaseName }}-${{ inputs.cluster }}
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup ArgoCD CLI
uses: imajeetyadav/argocd-cli@v1
with:
version: v2.9.3 # optional
- name: Deploy to Argo
run: |
argocd app create ${{ env.APP_NAME }} \
--repo https://github.com/${{ github.repository }} \
--path ${{ inputs.dir }} \
--project ${{ inputs.namespace }} \
--dest-name ${{ inputs.cluster }} \
--dest-namespace ${{ inputs.namespace }} \
--config-management-plugin=avp-kustomize \
--revision ${{ inputs.revision }} \
--plugin-env AVP_SECRET=guardian:avp-${{ inputs.cluster }} \
--plugin-env APP_REPO=${{ github.repository }} \
--plugin-env IMAGE_NAME=${{ inputs.images }} \
--plugin-env IMAGE_TAG=${{ inputs.tag }} \
--sync-policy automated \
--sync-option ApplyOutOfSyncOnly=true,ServerSideApply=true \
--upsert
- name: Get app info
run: argocd app get ${{ env.APP_NAME }}