Skip to content

Commit ef30944

Browse files
committed
Add protected automated deployment to environments
chore: Remove kubeconfig dependency (@gytis-ivaskevicius commit) chore: Add workflow for protected auto deployments (extra configuration done in repo > settings > environments)
1 parent 3630c5c commit ef30944

File tree

2 files changed

+49
-1
lines changed

2 files changed

+49
-1
lines changed

.github/workflows/deploy-env.yaml

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Deploy Environment
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
environment:
7+
description: 'Environment to deploy to'
8+
type: choice
9+
required: true
10+
default: 'ops-preview-1'
11+
options:
12+
options:
13+
- ops-preview-1
14+
region:
15+
description: 'Region containing cluster to deploy to'
16+
type: choice
17+
required: true
18+
default: 'us-east-1'
19+
options:
20+
- us-east-1
21+
- us-east-2
22+
- eu-central-1
23+
24+
jobs:
25+
deploy:
26+
environment: ${{ inputs.environment }}
27+
runs-on: ubuntu-latest
28+
steps:
29+
- name: 📥 Checkout repository
30+
uses: actions/checkout@v3
31+
32+
- name: Install QEMU
33+
run: sudo apt-get install -y qemu-user-static
34+
35+
- name: 🧰 Setup Nix
36+
uses: cachix/install-nix-action@v21
37+
with:
38+
extra_nix_config: |
39+
system = aarch64-linux
40+
41+
- name: 🚀 Deploy
42+
run: |
43+
echo "${{ secrets.ENVRC }}" > .envrc
44+
source .envrc
45+
nix develop
46+
nix run .#cardano-services.${{ inputs.environment }}@${{ inputs.region }}.status
47+
nix run .#cardano-services.${{ inputs.environment }}@${{ inputs.region }}.plan
48+
nix run .#cardano-services.${{ inputs.environment }}@${{ inputs.region }}.apply -y

nix/cardano-services/deployments/default.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ in
3838
name = "${final.namespace}-cardanojs";
3939
chart = ./Chart.yaml;
4040
context = "eks-devs";
41-
kubeconfig = "$PRJ_ROOT/.kube/${final.region}";
41+
kubeconfig = ./../../local/kubeconfig + "/${final.region}";
4242

4343
utils = {
4444
mkPodEnv = lib.mapAttrsToList (

0 commit comments

Comments
 (0)