kopia lustrzana https://github.com/cloudflare/wildebeest
fix commit hash setting
rodzic
9256d39647
commit
5ec212f3df
|
@ -1,7 +1,7 @@
|
|||
name: Deploy
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
branches:
|
||||
- main
|
||||
repository_dispatch:
|
||||
jobs:
|
||||
|
@ -76,9 +76,9 @@ jobs:
|
|||
|
||||
- name: retrieve Zero Trust organization
|
||||
run: |
|
||||
auth_domain=$(curl https://api.cloudflare.com/client/v4/accounts/${{ secrets.CF_ACCOUNT_ID }}/access/organizations \
|
||||
-H 'Authorization: Bearer ${{ secrets.CF_API_TOKEN }}' | jq -r '.result.auth_domain')
|
||||
printf "auth_domain=$auth_domain" >> $GITHUB_ENV
|
||||
auth_domain=$(curl https://api.cloudflare.com/client/v4/accounts/${{ secrets.CF_ACCOUNT_ID }}/access/organizations \
|
||||
-H 'Authorization: Bearer ${{ secrets.CF_API_TOKEN }}' | jq -r '.result.auth_domain')
|
||||
printf "auth_domain=$auth_domain" >> $GITHUB_ENV
|
||||
|
||||
- name: retrieve Terraform state KV namespace
|
||||
uses: cloudflare/wrangler-action@2.0.0
|
||||
|
@ -161,7 +161,7 @@ jobs:
|
|||
env:
|
||||
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }}
|
||||
if: ${{ env.tfstate_kv == '' }}
|
||||
|
||||
|
||||
- name: store VAPID keys state
|
||||
uses: cloudflare/wrangler-action@2.0.0
|
||||
with:
|
||||
|
@ -191,3 +191,4 @@ jobs:
|
|||
command: pages publish --project-name=wildebeest-${{ env.OWNER_LOWER }} .
|
||||
env:
|
||||
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }}
|
||||
COMMIT_HASH: ${{ github.sha }}
|
||||
|
|
|
@ -26,6 +26,7 @@ export const instanceLoader = loader$<
|
|||
|
||||
export default component$(() => {
|
||||
useContextProvider(InstanceConfigContext, instanceLoader.use().value)
|
||||
const commitHash = getCommitHash()
|
||||
|
||||
return (
|
||||
<>
|
||||
|
@ -52,7 +53,7 @@ export default component$(() => {
|
|||
</div>
|
||||
</main>
|
||||
<footer class="flex justify-end p-2 bg-wildebeest-600 border-t border-wildebeest-700 xl:bg-transparent xl:mt-10 xl:mx-6">
|
||||
<p class="text-sm text-wildebeest-500">v.{getCommitHash()}</p>
|
||||
{commitHash && <p class="text-sm text-wildebeest-500">v.{commitHash}</p>}
|
||||
</footer>
|
||||
</>
|
||||
)
|
||||
|
|
|
@ -2,9 +2,8 @@ import { defineConfig } from 'vite'
|
|||
import { qwikVite } from '@builder.io/qwik/optimizer'
|
||||
import { qwikCity } from '@builder.io/qwik-city/vite'
|
||||
import tsconfigPaths from 'vite-tsconfig-paths'
|
||||
import { execSync } from 'child_process'
|
||||
|
||||
const commitHash = execSync('git rev-parse --short HEAD').toString().replace(/\n/g, '')
|
||||
const commitHash = process.env['COMMIT_HASH']?.slice(0, 7)
|
||||
|
||||
export default defineConfig(() => {
|
||||
return {
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
"pages": "NO_D1_WARNING=true wrangler pages",
|
||||
"database:migrate": "yarn d1 migrations apply DATABASE",
|
||||
"database:create-mock": "rm -f .wrangler/state/d1/DATABASE.sqlite3 && yarn database:migrate --local && node ./frontend/mock-db/run.mjs",
|
||||
"dev": "yarn build && yarn database:migrate --local && yarn pages dev frontend/dist --d1 DATABASE --persist --compatibility-date=2022-12-20",
|
||||
"dev": "export COMMIT_HASH=$(git rev-parse HEAD) && yarn build && yarn database:migrate --local && yarn pages dev frontend/dist --d1 DATABASE --persist --compatibility-date=2022-12-20",
|
||||
"test:ui": "yarn build && yarn database:create-mock && concurrently --success command-1 --kill-others \"yarn pages dev frontend/dist --d1 DATABASE --persist --port 6868 --compatibility-date=2022-12-20 || true\" \"yarn --cwd frontend jest --verbose\"",
|
||||
"deploy:init": "yarn pages project create wildebeest && yarn d1 create wildebeest",
|
||||
"deploy": "yarn build && yarn database:migrate && yarn pages publish frontend/dist --project-name=wildebeest"
|
||||
|
|
Ładowanie…
Reference in New Issue