-
-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathREADME.yaml
More file actions
166 lines (138 loc) · 5.2 KB
/
Copy pathREADME.yaml
File metadata and controls
166 lines (138 loc) · 5.2 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
#
# This is the canonical configuration for the `README.md`
# Run `make readme` to rebuild the `README.md`
#
# Name of this project
name: github-action-deploy-argocd
# Tags of this project
tags:
- github-action
# Logo for this project
#logo: docs/logo.png
# License of this project
license: "APACHE2"
# Canonical GitHub repo
github_repo: cloudposse/github-action-deploy-argocd
# Badges to display
badges:
- name: Latest Release
image: https://img.shields.io/github/release/cloudposse/github-action-deploy-argocd.svg?style=for-the-badge
url: https://github.com/cloudposse/github-action-deploy-argocd/releases/latest
- name: Last Updated
image: https://img.shields.io/github/last-commit/cloudposse/github-action-deploy-argocd.svg?style=for-the-badge
url: https://github.com/cloudposse/github-action-deploy-argocd/commits
- name: Slack Community
image: https://slack.cloudposse.com/for-the-badge.svg
url: https://cloudposse.com/slack
# List any related terraform modules that this module may be used with or that this module depends on.
related: []
# Short description of this project
description: Deploy on Kubernetes with ArgoCD
introduction: |-
Deploy on Kubernetes with Helm/HelmFile and ArgoCD.
references:
- name: "github-actions-workflows"
description: "Reusable workflows for different types of projects"
url: "https://github.com/cloudposse/github-actions-workflows"
# How to use this project
usage: |-
Deploy environment
```yaml
name: Pull Request
on:
pull_request:
branches: [ 'main' ]
types: [opened, synchronize, reopened]
jobs:
deploy:
runs-on: ubuntu-latest
environment:
name: preview
url: ${{ steps.deploy.outputs.webapp-url }}
steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1.7.0
with:
aws-region: us-west-2
role-to-assume: arn:aws:iam::111111111111:role/preview
role-session-name: deploy
- name: Deploy
uses: cloudposse/github-action-deploy-argocd@main
id: deploy
with:
cluster: https://github.com/cloudposse/argocd-deploy-non-prod-test/blob/main/plat/ue2-sandbox/apps
toolchain: helmfile
environment: preview
namespace: preview
application: test-app
github-pat: ${{ secrets.GITHUB_AUTH_PAT }}
repository: ${{ github.repository }}
ref: ${{ github.event.pull_request.head.ref }}
image: nginx
image-tag: latest
operation: deploy
debug: false
synchronously: true
deployment-id: ${{ github.run_id }}-${{ github.run_attempt }}
```
Destroy environment
```yaml
name: Pull Request
on:
pull_request:
branches: [ 'main' ]
types: [closed]
jobs:
destroy:
runs-on: ubuntu-latest
steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1.7.0
with:
aws-region: us-west-2
role-to-assume: arn:aws:iam::111111111111:role/preview
role-session-name: destroy
- name: Destroy
uses: cloudposse/github-action-deploy-helmfile@main
id: destroy
with:
cluster: https://github.com/cloudposse/argocd-deploy-non-prod-test/blob/main/plat/ue2-sandbox/apps
toolchain: helmfile
environment: preview
namespace: preview
application: test-app
github-pat: ${{ secrets.GITHUB_AUTH_PAT }}
repository: ${{ github.repository }}
ref: ${{ github.event.pull_request.head.ref }}
image: "<none>"
image-tag: "<none>"
operation: destroy
debug: false
```
### Deduping ArgoCD notifications per deploy attempt
ArgoCD's notification `oncePer` trigger dedupes on whichever field you point it at. Keying it on the
application commit means a rollback — replaying a commit ArgoCD has already notified for — is silently
suppressed, and the rollback reports no status at all.
Pass `deployment-id` a value that is unique per *deploy attempt* rather than per code state, and point
`oncePer` at it instead:
```yaml
- name: Deploy
uses: cloudposse/github-action-deploy-argocd@main
with:
# ...
deployment-id: ${{ github.run_id }}-${{ github.run_attempt }}
```
The value is written to the generated `config.yaml` alongside the rest of the deploy metadata:
```yaml
app_repository: acme/example-app
app_commit: 6e6a0e1b0e0c4b2a9f1d3c5e7a9b1d3f5a7c9e1b
app_hostname: https://example-app.example.com
name: preview.example-app
namespace: preview
manifests: plat/ue2-sandbox/apps/preview/example-app/manifests
deployment_id: "12345678901-2"
```
The input is optional. Left at its empty default, the `deployment_id` key is omitted from `config.yaml`
entirely, so callers that do not set it get byte-identical output.
include: []
contributors: []