Skip to content
Merged
1 change: 1 addition & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ jobs:
- uses: actions/checkout@v3
- uses: nais/deploy/actions/deploy@v1
env:
VAR: commit=${{ github.sha }}
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
CLUSTER: dev-gcp
RESOURCE: .nais/nais.yaml
Expand Down
4 changes: 4 additions & 0 deletions .nais/nais.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ spec:
value: {{dekorator.url}}
- name: DEKORATOR_ENV
value: {{dekorator.env}}
- name: COMMIT
value: {{commit}}
accessPolicy:
outbound:
external:
Expand All @@ -62,5 +64,7 @@ spec:
enabled: true
level: {{idporten.level}}
autoLogin: true
autoLoginIgnorePaths:
- {{base_path}}/api/internal/info
tokenx:
enabled: true
1 change: 1 addition & 0 deletions app/models/rapporteringsperiode.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export async function godkjennPeriode(onBehalfOfToken: string, id: string): Prom
return await fetch(url, {
method: "POST",
headers: getHeaders(onBehalfOfToken),
body: JSON.stringify({ image: getEnv("NAIS_APP_IMAGE"), commit: getEnv("COMMIT") }),
});
}

Expand Down
2 changes: 2 additions & 0 deletions app/utils/env.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ interface IEnv {
DP_RAPPORTERING_TOKEN: string;
NAIS_CLUSTER_NAME: string;
USE_MSW: string;
NAIS_APP_IMAGE: string;
COMMIT: string;
}

export function getEnv(value: keyof IEnv) {
Expand Down
6 changes: 6 additions & 0 deletions server/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ const startServer = async () => {
(_, res: Response) => res.sendStatus(200)
);

const image = process.env.NAIS_APP_IMAGE;
const commit = process.env.COMMIT;
app.get([`${basePath}/api/internal/info`], (_, res: Response) =>
res.json({ image: image, commit: commit })
);

app.use(logRequests);

app.all(`${basePath}(/*)?`, handleRequestWithRemix);
Expand Down