fix(ci): correct path for renders
This commit is contained in:
6
.github/scripts/build.mjs
vendored
6
.github/scripts/build.mjs
vendored
@@ -158,6 +158,7 @@ async function template(id) {
|
||||
function testcase(name, env, args) {
|
||||
const { prod = {}, test = {}, ...step } = JSON.parse(JSON.stringify(args))
|
||||
const context = { prod, test }[env] ?? {}
|
||||
const {with:overrides} = context
|
||||
if (context.skip)
|
||||
return null
|
||||
|
||||
@@ -178,8 +179,9 @@ function testcase(name, env, args) {
|
||||
if (!(property in result.with))
|
||||
result.with[property] = value
|
||||
}
|
||||
if ((context.with?.output_action) && (context.with?.committer_branch === "examples"))
|
||||
Object.assign(result.with, { output_action: context.with.output_action, committer_branch: "examples" })
|
||||
if ((overrides?.output_action) && (overrides?.committer_branch === "examples")) {
|
||||
Object.assign(result.with, { output_action: overrides.output_action, committer_branch: "examples" })
|
||||
}
|
||||
}
|
||||
|
||||
if (env === "test") {
|
||||
|
||||
4
.github/scripts/files/examples.yml
vendored
4
.github/scripts/files/examples.yml
vendored
@@ -42,8 +42,8 @@ jobs:
|
||||
- name: Screenshot markdown example
|
||||
if: ${{ success() || failure() }}
|
||||
run: |
|
||||
node /metrics/.github/scripts/markdown_example.mjs
|
||||
mv metrics.markdown.png /
|
||||
docker run --entrypoint="" --volume=/tmp:/tmp ghcr.io/lowlighter/metrics:master node /metrics/.github/scripts/markdown_example.mjs
|
||||
sudo mv /tmp/metrics.markdown.png /metrics_renders/
|
||||
- name: Publish examples
|
||||
if: ${{ success() || failure() }}
|
||||
run: |
|
||||
|
||||
2
.github/scripts/markdown_example.mjs
vendored
2
.github/scripts/markdown_example.mjs
vendored
@@ -17,5 +17,5 @@ const clip = await page.evaluate(() => {
|
||||
const { x, y, width, height } = document.querySelector("#readme").getBoundingClientRect()
|
||||
return { x, y, width, height }
|
||||
})
|
||||
await page.screenshot({ type: "png", path: "metrics.markdown.png", clip, omitBackground: true })
|
||||
await page.screenshot({ type: "png", path: "/tmp/metrics.markdown.png", clip, omitBackground: true })
|
||||
await browser.close()
|
||||
|
||||
Reference in New Issue
Block a user