40
40
- uses : actions/checkout@v3
41
41
- uses : actions/setup-go@v2
42
42
with :
43
- go-version : " ^ 1.17"
43
+ go-version : " ~ 1.17"
44
44
- name : golangci-lint
45
45
46
46
with :
82
82
version : " 3.19.4"
83
83
- uses : actions/setup-go@v2
84
84
with :
85
- go-version : " ^ 1.17"
85
+ go-version : " ~ 1.17"
86
86
- run : curl -sSL
87
87
https://github.com/kyleconroy/sqlc/releases/download/v1.11.0/sqlc_1.11.0_linux_amd64.tar.gz
88
88
| sudo tar -C /usr/bin -xz sqlc
@@ -133,7 +133,7 @@ jobs:
133
133
134
134
- uses : actions/setup-go@v2
135
135
with :
136
- go-version : " ^ 1.17"
136
+ go-version : " ~ 1.17"
137
137
138
138
- name : Echo Go Cache Paths
139
139
id : go-cache-paths
@@ -201,7 +201,7 @@ jobs:
201
201
202
202
- uses : actions/setup-go@v2
203
203
with :
204
- go-version : " ^ 1.17"
204
+ go-version : " ~ 1.17"
205
205
206
206
- name : Echo Go Cache Paths
207
207
id : go-cache-paths
@@ -281,7 +281,7 @@ jobs:
281
281
deploy :
282
282
name : " deploy"
283
283
runs-on : ubuntu-latest
284
- if : github.event_name != 'pull_request '
284
+ if : github.ref == 'refs/heads/main '
285
285
permissions :
286
286
contents : read
287
287
id-token : write
@@ -291,36 +291,55 @@ jobs:
291
291
- name : Authenticate to Google Cloud
292
292
uses : google-github-actions/auth@v0
293
293
with :
294
- workload_identity_provider : projects/477254869654 /locations/global/workloadIdentityPools/github/providers/github
295
- service_account : github- coder@coder-ci .iam.gserviceaccount.com
294
+ workload_identity_provider : projects/573722524737 /locations/global/workloadIdentityPools/github/providers/github
295
+ service_account : coder-ci @coder-dogfood .iam.gserviceaccount.com
296
296
297
297
- name : Set up Google Cloud SDK
298
298
uses : google-github-actions/setup-gcloud@v0
299
299
300
- - name : Configure Docker for Google Artifact Registry
301
- run : gcloud auth configure-docker us-docker.pkg.dev
302
-
303
- - uses : actions/setup-node@v3
300
+ - uses : actions/setup-go@v2
304
301
with :
305
- node -version : " 14 "
302
+ go -version : " ~1.17 "
306
303
307
- - name : Install node_modules
308
- run : ./scripts/yarn_install.sh
304
+ - name : Echo Go Cache Paths
305
+ id : go-cache-paths
306
+ run : |
307
+ echo "::set-output name=go-build::$(go env GOCACHE)"
308
+ echo "::set-output name=go-mod::$(go env GOMODCACHE)"
309
309
310
- - uses : actions/setup-go@v2
310
+ - name : Go Build Cache
311
+ uses : actions/cache@v3
312
+ with :
313
+ path : ${{ steps.go-cache-paths.outputs.go-build }}
314
+ key : ${{ runner.os }}-release-go-build-${{ hashFiles('**/go.sum') }}
315
+
316
+ - name : Go Mod Cache
317
+ uses : actions/cache@v3
311
318
with :
312
- go-version : " ^1.17"
319
+ path : ${{ steps.go-cache-paths.outputs.go-mod }}
320
+ key : ${{ runner.os }}-release-go-mod-${{ hashFiles('**/go.sum') }}
313
321
314
322
- uses : goreleaser/goreleaser-action@v2
315
323
with :
316
324
install-only : true
317
325
318
- - run : make docker/image/coder
326
+ - name : Build Release
327
+ run : make release
328
+
329
+ - uses : actions/upload-artifact@v3
330
+ with :
331
+ name : coder_linux_amd64.deb
332
+ path : ./dist/coder_*_linux_amd64.deb
319
333
320
- - run : docker push us-docker.pkg.dev/coder-blacktriangle-dev/ci/coder:latest
334
+ - name : Install Release
335
+ run : |
336
+ gcloud config set project coder-dogfood
337
+ gcloud config set compute/zone us-central1-a
338
+ gcloud compute scp ./dist/coder_*_linux_amd64.deb coder:/tmp/coder.deb
339
+ gcloud compute ssh coder -- sudo dpkg -i /tmp/coder.deb
321
340
322
- - name : Update coder service
323
- run : gcloud run services update coder --image us-docker.pkg.dev/coder-blacktriangle-dev/ci/coder:latest --project coder-blacktriangle-dev --tag "git-$(git rev-parse --short HEAD)" --region us-central1
341
+ - name : Start
342
+ run : gcloud compute ssh coder -- sudo service coder restart
324
343
325
344
test-js :
326
345
name : " test/js"
@@ -342,7 +361,7 @@ jobs:
342
361
# Go is required for uploading the test results to datadog
343
362
- uses : actions/setup-go@v2
344
363
with :
345
- go-version : " ^ 1.17"
364
+ go-version : " ~ 1.17"
346
365
347
366
- uses : actions/setup-node@v3
348
367
with :
@@ -406,7 +425,7 @@ jobs:
406
425
# Go is required for uploading the test results to datadog
407
426
- uses : actions/setup-go@v2
408
427
with :
409
- go-version : " ^ 1.17"
428
+ go-version : " ~ 1.17"
410
429
411
430
- uses : hashicorp/setup-terraform@v1
412
431
with :
@@ -439,7 +458,9 @@ jobs:
439
458
path : ${{ steps.go-cache-paths.outputs.go-mod }}
440
459
key : ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
441
460
442
- - run : make build
461
+ - name : Build
462
+ run : |
463
+ make site/out
443
464
444
465
- run : yarn playwright:install
445
466
working-directory : site
0 commit comments