Skip to content

Commit 3b3bacd

Browse files
committed
Have prod/dev stacks (#10)
1 parent d169ea1 commit 3b3bacd

File tree

6 files changed

+139
-13
lines changed

6 files changed

+139
-13
lines changed

.github/workflows/deploy-demo.yaml .github/workflows/deploy-dev.yaml

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11

2-
name: Deploy to demo
2+
name: Deploy to dev
33

44
on:
55
workflow_dispatch:
66
push:
7-
tags:
8-
- v*
7+
branch:
8+
- dev
99

1010
permissions:
1111
contents: read
@@ -16,7 +16,7 @@ jobs:
1616

1717
deploy:
1818

19-
name: Deploy to demo
19+
name: Deploy to dev
2020
runs-on: ubuntu-latest
2121

2222
steps:
@@ -58,9 +58,9 @@ jobs:
5858
uses: pulumi/actions@v3
5959
with:
6060
command: up
61-
stack-name: demo
61+
stack-name: dev
6262
work-dir: pulumi
63-
cloud-url: gs://trustgraph-deploy/config-ui/demo
63+
cloud-url: gs://trustgraph-deploy/config-ui
6464
env:
6565
PULUMI_CONFIG_PASSPHRASE: ""
6666
IMAGE_VERSION: ${{ steps.version.outputs.VERSION }}

.github/workflows/deploy-prod.yaml

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
2+
name: Deploy to prod
3+
4+
on:
5+
workflow_dispatch:
6+
push:
7+
branch:
8+
- prod
9+
10+
permissions:
11+
contents: read
12+
id-token: 'write'
13+
packages: read
14+
15+
jobs:
16+
17+
deploy:
18+
19+
name: Deploy to prod
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
24+
- name: Checkout
25+
uses: actions/checkout@v3
26+
27+
- name: Get version
28+
id: version
29+
run: echo VERSION=$(git describe --exact-match --tags | sed 's/^v//') >> $GITHUB_OUTPUT
30+
31+
- name: Install deps
32+
run: npm install
33+
34+
- name: Build container
35+
run: make VERSION=${{ steps.version.outputs.VERSION }}
36+
37+
- id: auth
38+
name: Authenticate with Google Cloud
39+
uses: google-github-actions/auth@v2
40+
with:
41+
token_format: access_token
42+
workload_identity_provider: projects/583813057664/locations/global/workloadIdentityPools/deploy/providers/github
43+
service_account: [email protected]
44+
access_token_lifetime: 900s
45+
create_credentials_file: true
46+
47+
- name: Login to Artifact Registry
48+
uses: redhat-actions/podman-login@v1
49+
with:
50+
registry: us-central1-docker.pkg.dev
51+
username: oauth2accesstoken
52+
password: ${{ steps.auth.outputs.access_token }}
53+
54+
- name: Install Pulumi
55+
run: cd pulumi && npm install
56+
57+
- name: Applying infrastructure 🚀🙏
58+
uses: pulumi/actions@v3
59+
with:
60+
command: up
61+
stack-name: prod
62+
work-dir: pulumi
63+
cloud-url: gs://trustgraph-deploy/config-ui
64+
env:
65+
PULUMI_CONFIG_PASSPHRASE: ""
66+
IMAGE_VERSION: ${{ steps.version.outputs.VERSION }}
67+

.github/workflows/undeploy-demo.yaml .github/workflows/undeploy-dev.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
name: Undeploy to demo
2+
name: Undeploy to dev
33

44
on:
55
workflow_dispatch:
@@ -12,7 +12,7 @@ jobs:
1212

1313
deploy:
1414

15-
name: Undeploy to demo
15+
name: Undeploy to dev
1616
runs-on: ubuntu-latest
1717

1818
steps:
@@ -37,9 +37,9 @@ jobs:
3737
uses: pulumi/actions@v3
3838
with:
3939
command: destroy
40-
stack-name: demo
40+
stack-name: dev
4141
work-dir: pulumi
42-
cloud-url: gs://kalntera-deploy/cybersec-ai/demo
42+
cloud-url: gs://trustgraph-deploy/config-ui
4343
env:
4444
PULUMI_CONFIG_PASSPHRASE: ""
4545

.github/workflows/undeploy-prod.yaml

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
2+
name: Undeploy to prod
3+
4+
on:
5+
workflow_dispatch:
6+
7+
permissions:
8+
contents: read
9+
id-token: 'write'
10+
11+
jobs:
12+
13+
deploy:
14+
15+
name: Undeploy to prod
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
20+
- name: Checkout
21+
uses: actions/checkout@v3
22+
23+
- id: auth
24+
name: Authenticate with Google Cloud
25+
uses: google-github-actions/auth@v0
26+
with:
27+
token_format: access_token
28+
workload_identity_provider: projects/514167726704/locations/global/workloadIdentityPools/deploy/providers/deploy
29+
service_account: [email protected]
30+
access_token_lifetime: 900s
31+
create_credentials_file: true
32+
33+
- name: Install Pulumi
34+
run: cd pulumi && npm install
35+
36+
- name: Destroy infrastructure ☠🔥
37+
uses: pulumi/actions@v3
38+
with:
39+
command: destroy
40+
stack-name: prod
41+
work-dir: pulumi
42+
cloud-url: gs://trustgraph-deploy/config-ui
43+
env:
44+
PULUMI_CONFIG_PASSPHRASE: ""
45+

pulumi/Pulumi.dev.yaml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
encryptionsalt: v1:vQGk98eEeYI=:v1:tHg+f1b66tEydgA9:J1RGVNI0FssyjSXVhcKU7bfBofNFTg==
2+
config:
3+
config-ui:artifact-name: config-ui-dev
4+
config-ui:artifact-repo: us-central1-docker.pkg.dev/trustgraph-demo/config-ui-dev
5+
config-ui:artifact-repo-region: us-central1
6+
config-ui:cloud-run-region: us-central1
7+
config-ui:domain: demo.trustgraph.ai
8+
config-ui:environment: dev
9+
config-ui:gcp-project: trustgraph-demo
10+
config-ui:gcp-region: us-central1
11+
config-ui:hostname: dev.config-ui.demo.trustgraph.ai
12+
config-ui:managed-zone: demo
13+
config-ui:max-scale: "2"
14+
config-ui:min-scale: "0"

pulumi/Pulumi.demo.yaml pulumi/Pulumi.prod.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
encryptionsalt: v1:vQGk98eEeYI=:v1:tHg+f1b66tEydgA9:J1RGVNI0FssyjSXVhcKU7bfBofNFTg==
22
config:
3-
config-ui:artifact-name: config-ui
4-
config-ui:artifact-repo: us-central1-docker.pkg.dev/trustgraph-demo/config-ui
3+
config-ui:artifact-name: config-ui-prod
4+
config-ui:artifact-repo: us-central1-docker.pkg.dev/trustgraph-demo/config-ui-prod
55
config-ui:artifact-repo-region: us-central1
66
config-ui:cloud-run-region: us-central1
77
config-ui:domain: demo.trustgraph.ai
8-
config-ui:environment: demo
8+
config-ui:environment: prod
99
config-ui:gcp-project: trustgraph-demo
1010
config-ui:gcp-region: us-central1
1111
config-ui:hostname: config-ui.demo.trustgraph.ai

0 commit comments

Comments
 (0)