-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (83 loc) · 2.33 KB
/
deploy-v2-tpl.yaml
File metadata and controls
87 lines (83 loc) · 2.33 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
85
86
87
# 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
secrets:
ACCESS_KEY_ID:
required: true
ACCESS_KEY_SECRET:
required: true
env:
REGION_ID: us-east-1
CLUSTER_ID: cfc647c22fd6848b5a602ad4d7470632b
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set K8S context
uses: aliyun/ack-set-context@v1
with:
access-key-id: "${{ secrets.ACCESS_KEY_ID }}"
access-key-secret: "${{ secrets.ACCESS_KEY_SECRET }}"
cluster-id: "${{ env.CLUSTER_ID }}"
- uses: azure/setup-kubectl@v3
with:
version: ${{ inputs.version }} # default is latest stable
id: install
- name: Build Argo CD Application
id: argo-cd
uses: NaturalSelectionLabs/Daedalus/.github/actions/build-argocd-app@main
with:
name: ${{ inputs.releaseName }}
namespace: ${{ inputs.namespace }}
cluster: ${{ inputs.cluster }}
repo: ${{ github.repository }}
revision: ${{ inputs.revision }}
image-name: ${{ inputs.images }}
image-tag: ${{ inputs.tag }}
dir: ${{ inputs.dir }}
auto-sync: "${{ inputs.auto-sync }}"
- name: Get the output yaml
run: echo "${{ steps.argo-cd.outputs.app }}"
- name: Deploy to Argo
run: echo "${{ steps.argo-cd.outputs.app }}" | kubectl apply -f -