kopia lustrzana https://github.com/cloudflare/wildebeest
commit
cb7828821e
|
@ -1,7 +1,7 @@
|
||||||
name: Deploy
|
name: Deploy
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
repository_dispatch:
|
repository_dispatch:
|
||||||
jobs:
|
jobs:
|
||||||
|
@ -76,9 +76,9 @@ jobs:
|
||||||
|
|
||||||
- name: retrieve Zero Trust organization
|
- name: retrieve Zero Trust organization
|
||||||
run: |
|
run: |
|
||||||
auth_domain=$(curl https://api.cloudflare.com/client/v4/accounts/${{ secrets.CF_ACCOUNT_ID }}/access/organizations \
|
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')
|
-H 'Authorization: Bearer ${{ secrets.CF_API_TOKEN }}' | jq -r '.result.auth_domain')
|
||||||
printf "auth_domain=$auth_domain" >> $GITHUB_ENV
|
printf "auth_domain=$auth_domain" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: retrieve Terraform state KV namespace
|
- name: retrieve Terraform state KV namespace
|
||||||
uses: cloudflare/wrangler-action@2.0.0
|
uses: cloudflare/wrangler-action@2.0.0
|
||||||
|
@ -194,3 +194,4 @@ jobs:
|
||||||
command: pages publish --project-name=wildebeest-${{ env.OWNER_LOWER }} .
|
command: pages publish --project-name=wildebeest-${{ env.OWNER_LOWER }} .
|
||||||
env:
|
env:
|
||||||
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }}
|
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }}
|
||||||
|
COMMIT_HASH: ${{ github.sha }}
|
||||||
|
|
|
@ -26,6 +26,7 @@ export const instanceLoader = loader$<
|
||||||
|
|
||||||
export default component$(() => {
|
export default component$(() => {
|
||||||
useContextProvider(InstanceConfigContext, instanceLoader.use().value)
|
useContextProvider(InstanceConfigContext, instanceLoader.use().value)
|
||||||
|
const commitHash = getCommitHash()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
@ -52,7 +53,7 @@ export default component$(() => {
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</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">
|
<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>
|
</footer>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
|
|
|
@ -2,9 +2,8 @@ import { defineConfig } from 'vite'
|
||||||
import { qwikVite } from '@builder.io/qwik/optimizer'
|
import { qwikVite } from '@builder.io/qwik/optimizer'
|
||||||
import { qwikCity } from '@builder.io/qwik-city/vite'
|
import { qwikCity } from '@builder.io/qwik-city/vite'
|
||||||
import tsconfigPaths from 'vite-tsconfig-paths'
|
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(() => {
|
export default defineConfig(() => {
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
"pages": "NO_D1_WARNING=true wrangler pages",
|
"pages": "NO_D1_WARNING=true wrangler pages",
|
||||||
"database:migrate": "yarn d1 migrations apply DATABASE",
|
"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",
|
"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\"",
|
"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:init": "yarn pages project create wildebeest && yarn d1 create wildebeest",
|
||||||
"deploy": "yarn build && yarn database:migrate && yarn pages publish frontend/dist --project-name=wildebeest"
|
"deploy": "yarn build && yarn database:migrate && yarn pages publish frontend/dist --project-name=wildebeest"
|
||||||
|
|
Ładowanie…
Reference in New Issue