Skip to content

Commit 90aaab7

Browse files
committed
chore: update Vault secrets management and adjust ingress hosts for production and staging
1 parent 9f48b28 commit 90aaab7

File tree

3 files changed

+34
-13
lines changed

3 files changed

+34
-13
lines changed

.github/workflows/vault-docker-helm.yaml

+30-9
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,46 @@ on:
1212
jobs:
1313
docker:
1414
runs-on: ${{ vars.RUNNER_SCALE_SET }}
15+
env:
16+
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
17+
REPO_NAME: ${{ github.event.repository.name }}
18+
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
19+
1520
steps:
16-
- name: Import Secrets from Vault
17-
id: vault
21+
- name: Import management secrets from Vault
22+
id: management
1823
uses: hashicorp/vault-action@v3
1924
with:
2025
url: ${{ vars.VAULT_ADDR }}
21-
path: ${{ vars.VAULT_PATH }}
26+
path: management
2227
method: kubernetes
2328
role: ${{ vars.VAULT_ROLE }}
2429
secrets: |
25-
${{ vars.VAULT_PATH }}/data/${{ vars.VAULT_SECRET_PATH }} *
30+
management/data/${{ vars.VAULT_SECRET_PATH }} *
31+
32+
- name: Import production secrets from Vault
33+
id: production
34+
uses: hashicorp/vault-action@v3
35+
with:
36+
url: ${{ vars.VAULT_ADDR }}
37+
path: management
38+
method: kubernetes
39+
role: production-${{ env.REPO_NAME }}
40+
secrets: |
41+
production/data/${{ env.REPO_NAME }}/${{ env.REPO_NAME }} *
2642
2743
- name: Checkout code
2844
uses: actions/checkout@v4
2945

46+
- name: Create .env file
47+
run: |
48+
echo VITE_FEATURE_TOGGLE_CLIENT_KEY=${{ env.VITE_FEATURE_TOGGLE_CLIENT_KEY }} >> .env
49+
echo VITE_BRANCH_NAME=${{ env.BRANCH_NAME }} >> .env
50+
3051
- name: Configure npm authentication for GitHub Registry
3152
run: |
3253
echo "@compolabs:registry=https://npm.pkg.github.com/" > .npmrc
33-
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> .npmrc
54+
echo "//npm.pkg.github.com/:_authToken=${{ env.NODE_AUTH_TOKEN }}" >> .npmrc
3455
3556
- name: Login to Docker Registry
3657
uses: docker/login-action@v3
@@ -47,7 +68,7 @@ jobs:
4768
uses: docker/metadata-action@v5
4869
with:
4970
images: |
50-
${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_PROJECT }}/${{ vars.DOCKER_IMAGE }}
71+
${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_PROJECT }}/${{ env.REPO_NAME }}
5172
tags: |
5273
type=ref,event=branch
5374
type=ref,event=pr
@@ -69,11 +90,11 @@ jobs:
6990
uses: hashicorp/vault-action@v3
7091
with:
7192
url: ${{ vars.VAULT_ADDR }}
72-
path: ${{ vars.VAULT_PATH }}
93+
path: management
7394
method: kubernetes
7495
role: ${{ vars.VAULT_ROLE }}
7596
secrets: |
76-
${{ vars.VAULT_PATH }}/data/${{ vars.VAULT_SECRET_PATH }} *
97+
management/data/${{ vars.VAULT_SECRET_PATH }} *
7798
7899
- name: Checkout code
79100
uses: actions/checkout@v4
@@ -93,7 +114,7 @@ jobs:
93114
- name: Push Helm Chart
94115
uses: appany/helm-oci-chart-releaser@v0.3.0
95116
with:
96-
name: ${{ vars.DOCKER_IMAGE }}
117+
name: ${{ github.event.repository.name }}
97118
repository: charts
98119
tag: ${{ steps.meta.outputs.tags }}
99120
path: helm

helm/values.production.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
ingress:
22
enabled: true
33
hosts:
4-
- host: app.production.sprk.fi
4+
- host: app.production.v12.trade
55
paths:
66
- path: /
77
pathType: Prefix
88
tls:
99
- secretName: spark-frontend-tls
1010
hosts:
11-
- app.production.sprk.fi
11+
- app.production.v12.trade
1212

1313
vault:
1414
mount: production

helm/values.staging.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
ingress:
22
enabled: true
33
hosts:
4-
- host: app.staging.sprk.fi
4+
- host: app.staging.v12.trade
55
paths:
66
- path: /
77
pathType: Prefix
88
tls:
99
- secretName: spark-frontend-tls
1010
hosts:
11-
- app.staging.sprk.fi
11+
- app.staging.v12.trade
1212

1313
vault:
1414
mount: staging

0 commit comments

Comments
 (0)