Skip to content
Draft
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/update-docs-snippets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Update Docs Snippets

on:
workflow_dispatch:

push:
branches:
- main
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we also have backport branches like:
backport/wallet-gateway-remote/v0.17.x

How do you plan to handle different version of the different components (we track it using release tags) ?

paths:
- docs/wallet-integration-guide/examples/snippets/**
- docs/wallet-integration-guide/examples/scripts/**

jobs:
update-snippets:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5

- name: Extract Snippet data
run: node docs/scripts/generateOutputDocs.js

- name: Store Artifact output
id: store-artifact
uses: actions/upload-artifact@v4
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use actions/cache instead and have it as a hash of the output file ? this will save a lot of cost in the long run (instead of storing artifacts on every single run)

with:
name: splice-wallet-kernel-snippets
path: docs-output/
env:
main_repo_token: ${{ secrets.SOURCE_REPO_TOKEN }}

- name: Prepare additional params
id: additional-params
run: echo "short_sha=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"

- name: Update Main Docs Repo
uses: passeidireto/trigger-external-workflow-action@main
env:
PAYLOAD_run-id: ${{ github.run_id }}
PAYLOAD_artifact-id: ${{ steps.store-artifact.outputs.artifact-id }}
PAYLOAD_repo-name: ${{ vars.SOURCE_REPO_NAME }}
PAYLOAD_repo-org: ${{ vars.SOURCE_REPO_ORG }}
PAYLOAD_repo-version: ${{ vars.SOURCE_REPO_VERSION }}
PAYLOAD_trigger_sha_short: ${{ steps.additional-params.outputs.short_sha }}
with:
repository: ${{ vars.MAIN_REPO_ORG }}/${{ vars.MAIN_REPO_NAME }}
event: update_snippets
github_pat: ${{ secrets.MAIN_DOCS_REPO_TOKEN }}
Loading