Skip to content

docs(info-base): define graph navigation retrieval (#17) #22

docs(info-base): define graph navigation retrieval (#17)

docs(info-base): define graph navigation retrieval (#17) #22

Workflow file for this run

name: Pages deployment
on:
push:
branches:
- main
permissions:
contents: read
jobs:
build:
name: Build exact main release
runs-on: ubuntu-latest
timeout-minutes: 15
outputs:
artifact_digest: ${{ steps.artifact.outputs['artifact-digest'] }}
head_sha: ${{ steps.identity.outputs.head_sha }}
steps:
- name: Resolve exact current main source
id: identity
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
script: |
const currentMain = await github.rest.git.getRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'heads/main',
})
if (currentMain.data.object.sha !== context.sha) {
core.setFailed('A newer main revision superseded this release run.')
return
}
core.setOutput('head_sha', context.sha)
- name: Checkout exact main source
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ steps.identity.outputs.head_sha }}
persist-credentials: false
- name: Install the pinned pnpm release
uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
with:
package_json_file: website/package.json
- name: Set up Node
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6
with:
node-version-file: website/package.json
cache: pnpm
cache-dependency-path: website/pnpm-lock.yaml
- name: Install the frozen website package
run: pnpm --dir website install --frozen-lockfile
- name: Build and verify the website release
run: pnpm --dir website check
- name: Upload the exact release artifact
id: artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: inkcre-website-dist
path: website/.vitepress/dist
if-no-files-found: error
include-hidden-files: true
retention-days: 30
- name: Record release provenance
env:
ARTIFACT_DIGEST: ${{ steps.artifact.outputs['artifact-digest'] }}
RELEASE_HEAD_SHA: ${{ steps.identity.outputs.head_sha }}
run: |
{
echo '## Website release build'
echo
echo "- Source SHA: \`${RELEASE_HEAD_SHA}\`"
echo "- Workflow run: \`${GITHUB_RUN_ID}\`"
echo "- Artifact: \`inkcre-website-dist\`"
echo "- Artifact digest: \`${ARTIFACT_DIGEST}\`"
echo "- Trigger: \`${GITHUB_EVENT_NAME}\`"
} >> "${GITHUB_STEP_SUMMARY}"
deploy:
name: Deploy exact main release
needs: build
concurrency:
group: pages-main
cancel-in-progress: false
permissions:
contents: read
deployments: write
runs-on: ubuntu-latest
timeout-minutes: 20
environment:
name: production
url: https://inkcre.dev
steps:
- name: Checkout the exact delivery controller
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ needs.build.outputs.head_sha }}
path: controller
persist-credentials: false
- name: Set up Node
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6
with:
node-version-file: controller/website/package.json
- name: Download the same-run release artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: inkcre-website-dist
path: .pages-delivery/dist
- name: Reverify main before delivery
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
env:
RELEASE_HEAD_SHA: ${{ needs.build.outputs.head_sha }}
with:
script: |
const currentMain = await github.rest.git.getRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'heads/main',
})
if (currentMain.data.object.sha !== process.env.RELEASE_HEAD_SHA) {
core.setFailed('Main changed after the release build; refusing delivery.')
}
- name: Ensure the Pages project
run: node controller/website/scripts/configure-pages.mjs project
env:
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_PAGES_DOMAIN: inkcre.dev
CLOUDFLARE_PAGES_PROJECT: ${{ vars.CLOUDFLARE_PAGES_PROJECT }}
- name: Deploy to Cloudflare Pages
id: pages
uses: cloudflare/wrangler-action@ebbaa1584979971c8614a24965b4405ff95890e0 # v4.0.0
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
packageManager: npm
wranglerVersion: 4.114.0
workingDirectory: .pages-delivery
command: >-
pages deploy dist
--project-name=${{ vars.CLOUDFLARE_PAGES_PROJECT }}
--branch=main
--commit-hash=${{ needs.build.outputs.head_sha }}
--commit-dirty=false
- name: Ensure the custom domain
run: node controller/website/scripts/configure-pages.mjs domain
env:
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_PAGES_DOMAIN: inkcre.dev
CLOUDFLARE_PAGES_PROJECT: ${{ vars.CLOUDFLARE_PAGES_PROJECT }}
- name: Smoke-test Pages and inkcre.dev
run: node controller/website/scripts/verify-pages-deployment.mjs
env:
CLOUDFLARE_PAGES_DEPLOYMENT_ID: ${{ steps.pages.outputs.pages-deployment-id }}
CLOUDFLARE_PAGES_DEPLOYMENT_URL: ${{ steps.pages.outputs.deployment-url }}
INKCRE_PAGES_SMOKE_MODE: production
INKCRE_WEBSITE_ORIGIN: https://inkcre.dev