diff --git a/.github/workflows/build_container_image.yml b/.github/workflows/build_container_image.yml index b2b6901..3dce32e 100644 --- a/.github/workflows/build_container_image.yml +++ b/.github/workflows/build_container_image.yml @@ -5,7 +5,7 @@ on: branches: - main workflow_dispatch: - + env: DOCKER_HUB_ORGANIZATION: ${{ vars.DOCKER_HUB_ORGANIZATION }} DOCKER_HUB_REPOSITORY: ogcr-app @@ -13,20 +13,34 @@ env: jobs: build: runs-on: ubuntu-latest + env: + # Publishing needs the Docker Hub organisation and credentials, which only the upstream + # repository has. Without them (e.g. on a fork) the image is still built, so the + # Dockerfile is checked on every push, but not pushed or signed. + CAN_PUBLISH: ${{ vars.DOCKER_HUB_ORGANIZATION != '' && secrets.DOCKER_HUB_USERNAME != '' && secrets.DOCKER_HUB_TOKEN != '' }} steps: - uses: actions/checkout@v4 - - name: Build the Docker image with latest tag + - name: Build the Docker image + run: docker build . --tag ogcr-app:$GITHUB_SHA + + - name: Publish the Docker image with latest tag + if: env.CAN_PUBLISH == 'true' run: | echo "${{ secrets.DOCKER_HUB_TOKEN }}" | docker login -u "${{ secrets.DOCKER_HUB_USERNAME }}" --password-stdin docker.io - docker build . --tag docker.io/${{ env.DOCKER_HUB_ORGANIZATION }}/${{ env.DOCKER_HUB_REPOSITORY }}:$GITHUB_SHA --tag docker.io/${{ env.DOCKER_HUB_ORGANIZATION }}/${{ env.DOCKER_HUB_REPOSITORY }}:main --tag docker.io/${{ env.DOCKER_HUB_ORGANIZATION }}/${{ env.DOCKER_HUB_REPOSITORY }}:latest + for tag in $GITHUB_SHA main latest; do + docker tag ogcr-app:$GITHUB_SHA docker.io/${{ env.DOCKER_HUB_ORGANIZATION }}/${{ env.DOCKER_HUB_REPOSITORY }}:$tag + done docker push docker.io/${{ env.DOCKER_HUB_ORGANIZATION }}/${{ env.DOCKER_HUB_REPOSITORY }} --all-tags echo docker ogcr-app with latest tag done - uses: sigstore/cosign-installer@main + if: env.CAN_PUBLISH == 'true' - name: Write signing key to disk (only needed for `cosign sign --key`) + if: env.CAN_PUBLISH == 'true' run: echo "${{ secrets.COSIGN_PRIVATE_KEY }}" > cosign.key - name: Sign container image with annotations from our environment + if: env.CAN_PUBLISH == 'true' env: COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }} run: | @@ -35,7 +49,3 @@ jobs: -a "workflow=${{ github.workflow }}" \ -a "ref=${{ github.sha }}" \ docker.io/${{ env.DOCKER_HUB_ORGANIZATION }}/${{ env.DOCKER_HUB_REPOSITORY }}:main - - - - diff --git a/src/lib/components/Kpi.svelte b/src/lib/components/Kpi.svelte index 3bbd2d2..1679868 100644 --- a/src/lib/components/Kpi.svelte +++ b/src/lib/components/Kpi.svelte @@ -13,6 +13,8 @@ * status signal. `accentBar={false}` gives the quiet icon-led tile used in a * dense row — which is what the registry summary uses, since a tone would * imply a judgement we have no data to make. + * + * `href` turns the label and value into links to the page behind the figure. */ import type { Snippet } from 'svelte'; @@ -25,6 +27,7 @@ icon, tone = 'positive', accentBar = true, + href, class: className = '', ...rest }: { @@ -34,6 +37,7 @@ icon?: Snippet; tone?: Tone; accentBar?: boolean; + href?: string; class?: string; [key: string]: unknown; } = $props(); @@ -48,10 +52,18 @@ {#if icon} {/if} - {label} + {#if href} + {label} + {:else} + {label} + {/if} -
{secondaryText}
{/if} @@ -135,6 +147,16 @@ font-variant-numeric: tabular-nums; } + /* The value link duplicates the label link, so it is taken out of the tab + order (tabindex="-1") to avoid two stops for one destination. */ + .ogcr-kpi__link { + text-decoration: none; + } + .ogcr-kpi__link:hover, + .ogcr-kpi__link:focus-visible { + text-decoration: underline; + } + .ogcr-kpi__secondary { margin: 0; font-family: var(--font-family-default); diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index a518b18..147fae9 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -25,7 +25,7 @@ chain: 'Chain', my: 'My', operators: 'Operators', - 'dynamic-entities': 'Entities', + schema: 'Schema', create: 'Create', user: 'My Account', login: 'Login', diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index eecf0ef..a495490 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -62,22 +62,22 @@ const tools = $derived( [ { - href: '/dynamic-entities', + href: '/schema', icon: Database, - title: 'Entities', - description: 'Lookup, link, main and on-chain tables, with their endpoints and roles.' + title: 'Schema', + description: 'View schema and endpoints.' }, { href: data.apiManagerUrl, icon: Wrench, title: 'API Manager', - description: 'Manage OBP entities, roles and consumers.' + description: 'Manage schema and access.' }, { href: data.mcpUrl, icon: Bot, title: 'MCP Server', - description: 'Connect an AI assistant to OBP.' + description: 'Connect AI tools to the API.' } ].filter((tool): tool is typeof tool & { href: string } => tool.href !== null) ); @@ -116,7 +116,7 @@ {#if tools.length > 0}