mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 10:18:54 +00:00
fix(website): fix sha of deployed portal (#5782)
Needs a storage key, not an env var to read.
This commit is contained in:
18
.github/workflows/_deploy_production.yml
vendored
18
.github/workflows/_deploy_production.yml
vendored
@@ -184,18 +184,12 @@ jobs:
|
||||
needs: deploy-production
|
||||
runs-on: ubuntu-22.04
|
||||
env:
|
||||
VERCEL_PROJECT: firezone
|
||||
VERCEL_SLUG: firezone
|
||||
# Fetched from Vercel's API. Not a secret.
|
||||
VERCEL_ENV_VAR_ID: Ph436pR2So7nwrSI
|
||||
VERCEL_TEAM_ID: firezone
|
||||
VERCEL_EDGE_CONFIG_ID: ecfg_hmorgeez26rwyncgsuj1yaibfx4p
|
||||
steps:
|
||||
- name: Update FIREZONE_DEPLOYED_SHA
|
||||
run: |
|
||||
curl --fail -X PATCH "https://api.vercel.com/v9/projects/${VERCEL_PROJECT}/env/${VERCEL_ENV_VAR_ID}?slug=${VERCEL_SLUG}" \
|
||||
-H "Authorization: Bearer ${{ secrets.VERCEL_TOKEN }}" -H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"comment": "latest deployed SHA for control plane",
|
||||
"key": "FIREZONE_DEPLOYED_SHA",
|
||||
"type": "plain",
|
||||
"value": "${{ inputs.tag }}"
|
||||
}'
|
||||
curl --fail -X PATCH "https://api.vercel.com/v1/edge-config/${VERCEL_EDGE_CONFIG_ID}/items?teamId=${VERCEL_TEAM_ID}" \
|
||||
-H "Authorization: Bearer ${{ secrets.VERCEL_TOKEN }}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{ "items": [ { "operation": "upsert", "key": "deployed_sha", "value": "${{ inputs.tag }}" } ] }'
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
"@types/react": "18.3.3",
|
||||
"@types/react-dom": "18.3.0",
|
||||
"@types/react-syntax-highlighter": "^15.5.11",
|
||||
"@vercel/edge-config": "^1.2.0",
|
||||
"asciinema-player": "^3.7.1",
|
||||
"autoprefixer": "10.4.19",
|
||||
"fast-xml-parser": "^4.3.5",
|
||||
|
||||
21
website/pnpm-lock.yaml
generated
21
website/pnpm-lock.yaml
generated
@@ -41,6 +41,9 @@ importers:
|
||||
'@types/react-syntax-highlighter':
|
||||
specifier: ^15.5.11
|
||||
version: 15.5.13
|
||||
'@vercel/edge-config':
|
||||
specifier: ^1.2.0
|
||||
version: 1.2.0
|
||||
asciinema-player:
|
||||
specifier: ^3.7.1
|
||||
version: 3.7.1
|
||||
@@ -462,6 +465,18 @@ packages:
|
||||
'@ungap/structured-clone@1.2.0':
|
||||
resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==}
|
||||
|
||||
'@vercel/edge-config-fs@0.1.0':
|
||||
resolution: {integrity: sha512-NRIBwfcS0bUoUbRWlNGetqjvLSwgYH/BqKqDN7vK1g32p7dN96k0712COgaz6VFizAm9b0g6IG6hR6+hc0KCPg==}
|
||||
|
||||
'@vercel/edge-config@1.2.0':
|
||||
resolution: {integrity: sha512-ouX+hJK4KzXE31Wi2Xs7IEXb+6gImcOXgeOT9P48YKsZb7oNG2uyhvKDDkAyOJ739AnCJ5tKxavXjIoit6dWtw==}
|
||||
engines: {node: '>=14.6'}
|
||||
peerDependencies:
|
||||
'@opentelemetry/api': ^1.7.0
|
||||
peerDependenciesMeta:
|
||||
'@opentelemetry/api':
|
||||
optional: true
|
||||
|
||||
'@webassemblyjs/ast@1.12.1':
|
||||
resolution: {integrity: sha512-EKfMUOPRRUTy5UII4qJDGPpqfwjOmZ5jeGFwid9mnoqIFK+e0vqoi1qH56JpmZSzEL53jKnNzScdmftJyG5xWg==}
|
||||
|
||||
@@ -2235,6 +2250,12 @@ snapshots:
|
||||
|
||||
'@ungap/structured-clone@1.2.0': {}
|
||||
|
||||
'@vercel/edge-config-fs@0.1.0': {}
|
||||
|
||||
'@vercel/edge-config@1.2.0':
|
||||
dependencies:
|
||||
'@vercel/edge-config-fs': 0.1.0
|
||||
|
||||
'@webassemblyjs/ast@1.12.1':
|
||||
dependencies:
|
||||
'@webassemblyjs/helper-numbers': 1.11.6
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
// app/api/deployed-sha/route.ts
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
import { get } from "@vercel/edge-config";
|
||||
|
||||
export async function GET(req: NextRequest) {
|
||||
const sha = process.env.FIREZONE_DEPLOYED_SHA;
|
||||
export async function GET(_req: NextRequest) {
|
||||
const sha = await get("deployed_sha");
|
||||
return NextResponse.json({ sha });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user