19
19
build-and-push-backend :
20
20
runs-on : ubuntu-latest
21
21
steps :
22
- -
23
- uses : actions/create-github-app-token@v1
24
- id : app-token
25
- with :
26
- app-id : ${{ secrets.APP_ID }}
27
- private-key : ${{ secrets.PRIVATE_KEY }}
28
- owner : ${{ github.repository_owner }}
29
- repositories : " impress,secrets"
30
22
-
31
23
name : Checkout repository
32
- uses : actions/checkout@v2
33
- with :
34
- submodules : recursive
35
- token : ${{ steps.app-token.outputs.token }}
36
- -
37
- name : Load sops secrets
38
- uses : rouja/actions-sops@main
39
- with :
40
- secret-file : secrets/numerique-gouv/impress/secrets.enc.env
41
- age-key : ${{ secrets.SOPS_PRIVATE }}
24
+ uses : actions/checkout@v4
42
25
-
43
26
name : Docker meta
44
27
id : meta
48
31
-
49
32
name : Login to DockerHub
50
33
if : github.event_name != 'pull_request'
51
- run : echo "$DOCKER_HUB_PASSWORD" | docker login -u "$DOCKER_HUB_USER" --password-stdin
34
+ run : echo "${{ secrets. DOCKER_HUB_PASSWORD }} " | docker login -u "${{ secrets. DOCKER_HUB_USER }} " --password-stdin
52
35
-
53
36
name : Run trivy scan
54
37
uses : numerique-gouv/action-trivy-cache@main
70
53
build-and-push-frontend :
71
54
runs-on : ubuntu-latest
72
55
steps :
73
- -
74
- uses : actions/create-github-app-token@v1
75
- id : app-token
76
- with :
77
- app-id : ${{ secrets.APP_ID }}
78
- private-key : ${{ secrets.PRIVATE_KEY }}
79
- owner : ${{ github.repository_owner }}
80
- repositories : " impress,secrets"
81
56
-
82
57
name : Checkout repository
83
- uses : actions/checkout@v2
84
- with :
85
- submodules : recursive
86
- token : ${{ steps.app-token.outputs.token }}
87
- -
88
- name : Load sops secrets
89
- uses : rouja/actions-sops@main
90
- with :
91
- secret-file : secrets/numerique-gouv/impress/secrets.enc.env
92
- age-key : ${{ secrets.SOPS_PRIVATE }}
58
+ uses : actions/checkout@v4
93
59
-
94
60
name : Docker meta
95
61
id : meta
99
65
-
100
66
name : Login to DockerHub
101
67
if : github.event_name != 'pull_request'
102
- run : echo "$DOCKER_HUB_PASSWORD" | docker login -u "$DOCKER_HUB_USER" --password-stdin
68
+ run : echo "${{ secrets. DOCKER_HUB_PASSWORD }} " | docker login -u "${{ secrets. DOCKER_HUB_USER }} " --password-stdin
103
69
-
104
70
name : Run trivy scan
105
71
uses : numerique-gouv/action-trivy-cache@main
@@ -122,26 +88,9 @@ jobs:
122
88
build-and-push-y-provider :
123
89
runs-on : ubuntu-latest
124
90
steps :
125
- -
126
- uses : actions/create-github-app-token@v1
127
- id : app-token
128
- with :
129
- app-id : ${{ secrets.APP_ID }}
130
- private-key : ${{ secrets.PRIVATE_KEY }}
131
- owner : ${{ github.repository_owner }}
132
- repositories : " impress,secrets"
133
91
-
134
92
name : Checkout repository
135
- uses : actions/checkout@v2
136
- with :
137
- submodules : recursive
138
- token : ${{ steps.app-token.outputs.token }}
139
- -
140
- name : Load sops secrets
141
- uses : rouja/actions-sops@main
142
- with :
143
- secret-file : secrets/numerique-gouv/impress/secrets.enc.env
144
- age-key : ${{ secrets.SOPS_PRIVATE }}
93
+ uses : actions/checkout@v4
145
94
-
146
95
name : Docker meta
147
96
id : meta
@@ -151,7 +100,7 @@ jobs:
151
100
-
152
101
name : Login to DockerHub
153
102
if : github.event_name != 'pull_request'
154
- run : echo "$DOCKER_HUB_PASSWORD" | docker login -u "$DOCKER_HUB_USER" --password-stdin
103
+ run : echo "${{ secrets. DOCKER_HUB_PASSWORD }} " | docker login -u "${{ secrets. DOCKER_HUB_USER }} " --password-stdin
155
104
-
156
105
name : Run trivy scan
157
106
uses : numerique-gouv/action-trivy-cache@main
@@ -179,29 +128,12 @@ jobs:
179
128
if : |
180
129
github.event_name != 'pull_request'
181
130
steps :
182
- -
183
- uses : actions/create-github-app-token@v1
184
- id : app-token
185
- with :
186
- app-id : ${{ secrets.APP_ID }}
187
- private-key : ${{ secrets.PRIVATE_KEY }}
188
- owner : ${{ github.repository_owner }}
189
- repositories : " impress,secrets"
190
131
-
191
132
name : Checkout repository
192
- uses : actions/checkout@v2
193
- with :
194
- submodules : recursive
195
- token : ${{ steps.app-token.outputs.token }}
196
- -
197
- name : Load sops secrets
198
- uses : rouja/actions-sops@main
199
- with :
200
- secret-file : secrets/numerique-gouv/impress/secrets.enc.env
201
- age-key : ${{ secrets.SOPS_PRIVATE }}
133
+ uses : actions/checkout@v4
202
134
-
203
135
name : Call argocd github webhook
204
136
run : |
205
137
data='{"ref": "'$GITHUB_REF'","repository": {"html_url":"'$GITHUB_SERVER_URL'/'$GITHUB_REPOSITORY'"}}'
206
- sig=$(echo -n ${data} | openssl dgst -sha1 -hmac ''${ARGOCD_WEBHOOK_SECRET }'' | awk '{print "X-Hub-Signature: sha1="$2}')
207
- curl -X POST -H 'X-GitHub-Event:push' -H "Content-Type: application/json" -H "${sig}" --data "${data}" $ARGOCD_WEBHOOK_URL
138
+ sig=$(echo -n ${data} | openssl dgst -sha1 -hmac ''${{ secrets.ARGOCD_PREPROD_WEBHOOK_SECRET} }'' | awk '{print "X-Hub-Signature: sha1="$2}')
139
+ curl -X POST -H 'X-GitHub-Event:push' -H "Content-Type: application/json" -H "${sig}" --data "${data}" ${{ vars.ARGOCD_PREPROD_WEBHOOK_URL }}
0 commit comments