Skip to content

Commit df009ec

Browse files
made changes to example app tutorial workflow to ensure independence
1 parent 334e014 commit df009ec

File tree

2 files changed

+127
-43
lines changed

2 files changed

+127
-43
lines changed

.github/workflows/publish-docs.yaml

Lines changed: 26 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ jobs:
2424
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
2525
with:
2626
fetch-depth: 0
27-
# For testing, use the SDK development branch
28-
ref: DVR-330-example-apps-content-autogeneration
2927

3028
- name: Check alpha version
3129
id: alpha_check
@@ -64,17 +62,14 @@ jobs:
6462
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
6563
with:
6664
fetch-depth: 0
67-
# For testing, use the SDK development branch
68-
ref: DVR-330-example-apps-content-autogeneration
6965

7066
- name: Checkout Docs Repo
7167
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
7268
with:
7369
repository: immutable/docs
7470
token: ${{ secrets.TS_IMMUTABLE_SDK_GITHUB_TOKEN }}
7571
path: imx-docs
76-
# For testing, use the docs development branch
77-
ref: DVR-331-example-app-layout
72+
ref: main
7873

7974
- name: Setup environment variables
8075
run: |
@@ -109,44 +104,32 @@ jobs:
109104
- name: Update version link
110105
run: ./.github/scripts/update-docs-link.sh
111106

112-
- name: Process Example App Tutorials
113-
run: |
114-
# Generate example app JSON files
115-
pnpm parse:examples
116-
117-
# Process tutorials and copy to docs repo
118-
./.github/scripts/process-tutorials.sh
119-
shell: bash
120-
121107
- name: Push SDK Docs to docs
122108
id: docs_push
123-
run: |
124-
# Modify push-docs.sh to push to the testing branch
125-
cd "$CLONE_DIR"
126-
git push -u origin DVR-331-example-app-layout
109+
run: ./.github/scripts/push-docs.sh
127110
shell: bash
128111

129-
# - name: Trigger Netlify Build and Deploy
130-
# id: netlify_build
131-
# run: curl -X POST -d '{}' ${{ env.NETLIFY_BUILD_HOOK }}
132-
133-
# - name: Wait for 10 minutes
134-
# # allow Netlify time to build and deploy
135-
# run: sleep 600
136-
137-
# - name: Check Netlify Site Deployed
138-
# id: netlify_deploy
139-
# run: ./.github/scripts/check-docs-deployed.sh
140-
# shell: bash
141-
142-
# - name: Notify SDK Slack Docs Publish Success
143-
# if: ${{ success() && steps.docs_push.conclusion == 'success' && steps.netlify_build.conclusion == 'success' && steps.netlify_deploy.conclusion == 'success' }}
144-
# uses: ./.github/actions/notify-slack-publish-status
145-
# with:
146-
# message: "✅ SDK reference documents published successfully - https://docs.immutable.com/sdk-references/ts-immutable-sdk/${{ env.VERSION }}/\n\n>*`${{ env.GITHUB_USER }}` Please ensure you and the team updated all Sample Code + Guides on the <https://docs.immutable.com|imx-docs site> to reflect the change.*"
147-
148-
# - name: Notify SDK Slack Docs Publish Failure
149-
# if: ${{ failure() && steps.docs_version_check.conclusion == 'success' }}
150-
# uses: ./.github/actions/notify-slack-publish-status
151-
# with:
152-
# message: "❌ Failed to publish SDK reference documents. Please check the logs for more details."
112+
- name: Trigger Netlify Build and Deploy
113+
id: netlify_build
114+
run: curl -X POST -d '{}' ${{ env.NETLIFY_BUILD_HOOK }}
115+
116+
- name: Wait for 10 minutes
117+
# allow Netlify time to build and deploy
118+
run: sleep 600
119+
120+
- name: Check Netlify Site Deployed
121+
id: netlify_deploy
122+
run: ./.github/scripts/check-docs-deployed.sh
123+
shell: bash
124+
125+
- name: Notify SDK Slack Docs Publish Success
126+
if: ${{ success() && steps.docs_push.conclusion == 'success' && steps.netlify_build.conclusion == 'success' && steps.netlify_deploy.conclusion == 'success' }}
127+
uses: ./.github/actions/notify-slack-publish-status
128+
with:
129+
message: "✅ SDK reference documents published successfully - https://docs.immutable.com/sdk-references/ts-immutable-sdk/${{ env.VERSION }}/\n\n>*`${{ env.GITHUB_USER }}` Please ensure you and the team updated all Sample Code + Guides on the <https://docs.immutable.com|imx-docs site> to reflect the change.*"
130+
131+
- name: Notify SDK Slack Docs Publish Failure
132+
if: ${{ failure() && steps.docs_version_check.conclusion == 'success' }}
133+
uses: ./.github/actions/notify-slack-publish-status
134+
with:
135+
message: "❌ Failed to publish SDK reference documents. Please check the logs for more details."
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
name: Publish Example App Tutorials
2+
3+
on:
4+
# Run when changes are pushed to example tutorials or metadata
5+
push:
6+
paths:
7+
- 'examples/*/*/tutorial.md'
8+
- 'examples/*/*/metadata.json'
9+
- 'examples/_scripts/sample-app-parser.mjs'
10+
# Allow manual triggering
11+
workflow_dispatch:
12+
13+
concurrency:
14+
group: example-tutorials
15+
cancel-in-progress: true
16+
17+
jobs:
18+
PublishExampleTutorials:
19+
name: Process and Publish Example Tutorials
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout SDK Repo
23+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
24+
with:
25+
fetch-depth: 0
26+
# For testing, use the SDK development branch
27+
ref: DVR-330-example-apps-content-autogeneration
28+
29+
- name: Checkout Docs Repo
30+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
31+
with:
32+
repository: immutable/docs
33+
token: ${{ secrets.TS_IMMUTABLE_SDK_GITHUB_TOKEN }}
34+
path: imx-docs
35+
# For testing, use the docs development branch
36+
ref: DVR-331-example-app-layout
37+
38+
- name: Setup environment variables
39+
run: |
40+
echo "CLONE_DIR=./imx-docs" >> $GITHUB_ENV
41+
42+
- name: Setup Github
43+
run: |
44+
git config --global user.name "${GITHUB_ACTOR}"
45+
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
46+
47+
- name: Setup Node.js
48+
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8
49+
with:
50+
node-version: 18
51+
52+
- name: Install pnpm
53+
uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d
54+
with:
55+
version: 8.6.10
56+
run_install: false
57+
58+
- name: Get pnpm store directory
59+
id: pnpm-cache
60+
shell: bash
61+
run: |
62+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
63+
64+
- name: Setup pnpm cache
65+
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
66+
with:
67+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
68+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
69+
restore-keys: |
70+
${{ runner.os }}-pnpm-store-
71+
72+
- name: Install Dependencies
73+
run: pnpm install --frozen-lockfile
74+
75+
- name: Process Example App Tutorials
76+
run: |
77+
# Generate example app JSON files
78+
pnpm parse:examples
79+
80+
# Process tutorials and copy to docs repo
81+
./.github/scripts/process-tutorials.sh
82+
shell: bash
83+
84+
- name: Commit and Push Changes to Docs Repo
85+
run: |
86+
cd "$CLONE_DIR"
87+
# Check if there are changes to commit
88+
if git status --porcelain | grep -q .; then
89+
# Add all changes
90+
git add .
91+
92+
# Commit the changes
93+
git commit -m "Update example app tutorials from SDK repo"
94+
95+
# Push to the target branch
96+
git push -u origin DVR-331-example-app-layout
97+
echo "Successfully pushed example app tutorial changes to docs repo"
98+
else
99+
echo "No changes to commit"
100+
fi
101+
shell: bash

0 commit comments

Comments
 (0)