This repository was archived by the owner on May 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
77 lines (74 loc) · 2.6 KB
/
deploy-to-cloud.yaml
File metadata and controls
77 lines (74 loc) · 2.6 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
name: deploy-to-cloud
on:
deployment
jobs:
deploy:
runs-on: ubuntu-latest
steps:
-
uses: chrnorm/deployment-status@releases/v1
with:
deployment_id: ${{ github.event.deployment.id }}
description: Trigger the pipeline
state: "queued"
token: "${{ github.token }}"
-
name: Checkout
uses: actions/checkout@v2
-
uses: chrnorm/deployment-status@releases/v1
with:
deployment_id: ${{ github.event.deployment.id }}
description: Start to deploy to the Kubernetes
state: "in_progress"
token: "${{ github.token }}"
-
name: Deploy Dev
uses: WyriHaximus/github-action-helm3@v2
if: ${{ github.event.deployment.environment == 'dev' }}
with:
# Upgrade to the version.
exec: >
helm repo add gitployio https://gitploy-io.github.io/helm-chart/;
helm upgrade gitploy-dev gitployio/gitploy
--install
--atomic
--namespace=gitploy
-f release/values.dev.yaml
--set=image.tag=${GITHUB_REF#refs/tags/v}
--set=image.pullPolicy=${{ github.event.deployment.payload.pullPolicy }}
--description="Upgrade to ${GITHUB_REF#refs/tags/}"
kubeconfig: '${{ secrets.KUBECONFIG }}'
-
name: Deploy Production
uses: WyriHaximus/github-action-helm3@v2
if: ${{ github.event.deployment.environment == 'production' }}
with:
# Upgrade to the version.
exec: >
helm repo add gitployio https://gitploy-io.github.io/helm-chart/;
helm upgrade gitploy-prod gitployio/gitploy
--install
--atomic
--namespace=gitploy
-f release/values.production.yaml
--set=image.tag=${GITHUB_REF#refs/tags/v}
--set=image.pullPolicy=${{ github.event.deployment.payload.pullPolicy }}
--description="Upgrade to ${GITHUB_REF#refs/tags/}"
kubeconfig: '${{ secrets.KUBECONFIG }}'
-
if: success()
uses: chrnorm/deployment-status@releases/v1
with:
deployment_id: ${{ github.event.deployment.id }}
description: Finish to deploy successfully.
state: "success"
token: "${{ github.token }}"
-
if: failure()
uses: chrnorm/deployment-status@releases/v1
with:
deployment_id: ${{ github.event.deployment.id }}
description: Failed to deploy.
state: "failure"
token: "${{ github.token }}"