Skip to content

Commit bf6797a

Browse files
committed
Test preview against the docs-base image from grafana/website#32512
Point the caller at this branch's reusable workflow and pull the development docs-base image published from the website PR, so the preview exercises the redirects manifest path instead of the alias scraping fallback. The build-website job logs in to GAR when the image comes from us-docker.pkg.dev, which requires id-token permission from callers. Revert the caller ref and image pin to main and nightly before merge. Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
1 parent bc4ec8c commit bf6797a

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

.github/workflows/deploy-pr-preview.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ on:
1313

1414
jobs:
1515
deploy-pr-preview:
16-
uses: grafana/writers-toolkit/.github/workflows/deploy-preview.yml@main # zizmor: ignore[unpinned-uses] It's a protected branch in the same repository.
16+
# TODO: revert to @main before merge, iterating on the reusable workflow in this branch.
17+
uses: grafana/writers-toolkit/.github/workflows/deploy-preview.yml@jdb/deploy-preview # zizmor: ignore[unpinned-uses] It's a branch in the same repository.
1718
if: "!github.event.pull_request.head.repo.fork"
1819
permissions:
1920
contents: read # Clone repository.
@@ -23,7 +24,9 @@ jobs:
2324
with:
2425
branch: ${{ github.head_ref }}
2526
event_number: ${{ github.event.number }}
26-
image: grafana/docs-base:nightly
27+
# TODO: revert to grafana/docs-base:nightly before merge, testing the
28+
# docs-base image from grafana/website#32512.
29+
image: us-docker.pkg.dev/grafanalabs-dev/docker-website-dev/docs-base:0ca6ae60009434fe9a77e3adad6ed507c9c75e23
2730
repo: writers-toolkit
2831
sha: ${{ github.event.pull_request.head.sha }}
2932
sources: |

.github/workflows/deploy-preview.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,17 @@ jobs:
126126
website_directory: ${{ steps.preview-paths.outputs.website_directory != '' && steps.preview-paths.outputs.website_directory || env.WEBSITE_DIRECTORY }}
127127
permissions:
128128
contents: read # Clone repositories.
129+
id-token: write # Log in to GAR to pull development docs-base images.
129130
pull-requests: read # `gh pr checkout` in deploy-preview/build queries the pullRequests GraphQL API.
130131
if: github.event.action == 'opened' || github.event.action == 'synchronize'
131132
runs-on: ubuntu-latest
132133
steps:
134+
- name: Log in to GAR
135+
if: startsWith(inputs.image, 'us-docker.pkg.dev/')
136+
uses: grafana/shared-workflows/actions/login-to-gar@12c87e5aa323694c820c1ff3d8e47e8237e05136 # login-to-gar/v1.0.2
137+
with:
138+
registry: us-docker.pkg.dev
139+
133140
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
134141
if: inputs.website_directory
135142
with:

0 commit comments

Comments
 (0)