Skip to content

Commit 482ed84

Browse files
authored
feat: ci to build new registry on push to main (#363)
This PR adds a github actions workflow for deploying new revisions of the registry on pushes to main. This means updating the new registry will continue to be as simple as landing a PR in this repo, but it should only take as long as the docker container takes to build to see the updates live :) For now, updates go to dev for manual inspection, but once we're confident in the build process they'll go straight to main as well.
1 parent 32b6901 commit 482ed84

File tree

2 files changed

+41
-1
lines changed

2 files changed

+41
-1
lines changed
+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: deploy-registry
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
12+
# Set id-token permission for gcloud
13+
# Adding a comment because retriggering the build manually hung? I am the lord of devops and you will bend?
14+
permissions:
15+
contents: read
16+
id-token: write
17+
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
22+
- name: Authenticate to Google Cloud
23+
uses: google-github-actions/auth@6fc4af4b145ae7821d527454aa9bd537d1f2dc5f
24+
with:
25+
workload_identity_provider: projects/309789351055/locations/global/workloadIdentityPools/github-actions/providers/github
26+
service_account: registry-v2-github@coder-registry-1.iam.gserviceaccount.com
27+
28+
- name: Set up Google Cloud SDK
29+
uses: google-github-actions/setup-gcloud@6189d56e4096ee891640bb02ac264be376592d6a
30+
31+
# For the time being, let's have the first couple merges to main in modules deploy a new version
32+
# to *dev*. Once we review and make sure everything's working, we can deploy a new version to *main*.
33+
# Maybe in the future we could automate this based on the result of E2E tests.
34+
- name: Deploy to dev.registry.coder.com
35+
run: |
36+
gcloud builds triggers run 29818181-126d-4f8a-a937-f228b27d3d34 --branch dev
37+

.gitignore

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
.terraform*
22
node_modules
33
*.tfstate
4-
*.tfstate.lock.info
4+
*.tfstate.lock.info
5+
6+
# Ignore generated credentials from google-github-actions/auth
7+
gha-creds-*.json

0 commit comments

Comments
 (0)