Skip to content

Commit c039312

Browse files
authored
Merge pull request #10 from pvarki/Tinacms
Tinacms
2 parents 5626f18 + b3705db commit c039312

File tree

15 files changed

+599
-29
lines changed

15 files changed

+599
-29
lines changed

.github/workflows/docs.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88

99
jobs:
1010
pull-docs:
11-
if: github.event_name == 'push' && github.event.pusher.name != 'github-actions[bot]' && (!startsWith(github.event.head_commit.message, 'Merge pull request') || !contains(github.event.head_commit.message, 'release-please--branches--main'))
11+
if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.event.pusher.name != 'github-actions[bot]' && (!startsWith(github.event.head_commit.message, 'Merge pull request') || !contains(github.event.head_commit.message, 'release-please--branches--main'))
1212
runs-on: ubuntu-latest
1313
permissions:
1414
contents: read
@@ -37,7 +37,7 @@ jobs:
3737
path: ${{ github.workspace }}/docs/
3838

3939
commit-docs:
40-
if: github.event_name == 'push' && github.event.pusher.name != 'github-actions[bot]' && (!startsWith(github.event.head_commit.message, 'Merge pull request') || !contains(github.event.head_commit.message, 'release-please--branches--main'))
40+
if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.event.pusher.name != 'github-actions[bot]' && (!startsWith(github.event.head_commit.message, 'Merge pull request') || !contains(github.event.head_commit.message, 'release-please--branches--main'))
4141
runs-on: ubuntu-latest
4242
permissions:
4343
contents: write
@@ -85,7 +85,7 @@ jobs:
8585
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8686

8787
build:
88-
if: github.event_name == 'push' && github.event.pusher.name != 'github-actions[bot]' && (!startsWith(github.event.head_commit.message, 'Merge pull request') || !contains(github.event.head_commit.message, 'release-please--branches--main'))
88+
if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.event.pusher.name != 'github-actions[bot]' && (!startsWith(github.event.head_commit.message, 'Merge pull request') || !contains(github.event.head_commit.message, 'release-please--branches--main'))
8989
runs-on: ubuntu-latest
9090
permissions:
9191
contents: write
@@ -111,7 +111,7 @@ jobs:
111111
run: docker push pvarki/pvarkidocs:latest
112112

113113
deploy:
114-
if: github.event_name == 'push' && github.event.pusher.name != 'github-actions[bot]' && (!startsWith(github.event.head_commit.message, 'Merge pull request') || !contains(github.event.head_commit.message, 'release-please--branches--main'))
114+
if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.event.pusher.name != 'github-actions[bot]' && (!startsWith(github.event.head_commit.message, 'Merge pull request') || !contains(github.event.head_commit.message, 'release-please--branches--main'))
115115
runs-on: ubuntu-latest
116116
needs: build
117117
steps:
@@ -135,6 +135,9 @@ jobs:
135135
TINA_PUBLIC_CLIENT_ID: ${{ secrets.TINA_PUBLIC_CLIENT_ID }}
136136
TINA_TOKEN: ${{ secrets.TINA_TOKEN }}
137137
run: npm run build
138+
139+
- name: Remove gitignore file
140+
run: rm ./build/admin/.gitignore
138141

139142
- name: Deploy to GitHub Pages
140143
uses: peaceiris/actions-gh-pages@v3

build.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
#!/bin/bash
22
set -e
33

4+
# Build TinaCMS admin
5+
npx tina build
6+
7+
# Copy Tina admin to Docusaurus static folder
8+
rm -rf static/admin
9+
cp -r public/admin static/admin
10+
411
PROJECT_ROOT="$(pwd)"
512
SRC_DIR="$PROJECT_ROOT/src/decks/prebuilds"
613
OUT_DIR="$PROJECT_ROOT/static/decks"
@@ -18,5 +25,9 @@ find "$SRC_DIR" -name 'index.html' | while read -r html; do
1825
npx html-inline --nocompress --inlinemin --root "$PROJECT_ROOT" "$html" > "$out_path"
1926
done
2027

21-
2228
echo "✅ All slide decks inlined to: $OUT_DIR"
29+
30+
echo "🛠️ Building Docusaurus site..."
31+
npm run build
32+
33+
echo "✅ Build complete. Deploy the 'build/' folder to GitHub Pages."

sidebar.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
module.exports = {
2-
// Android
3-
...require('./src/sidebars/android/sidebar.deployapp'),
4-
...require('./src/sidebars/android/sidebar.tak'),
5-
...require('./src/sidebars/android/sidebar.bl'),
6-
7-
// iOS
8-
...require('./src/sidebars/ios/sidebar.deployapp'),
9-
...require('./src/sidebars/ios/sidebar.tak'),
10-
...require('./src/sidebars/ios/sidebar.bl'),
1+
const sidebarData = require('./src/sidebars/index.json');
112

12-
// Windows
13-
...require('./src/sidebars/windows/sidebar.deployapp'),
14-
...require('./src/sidebars/windows/sidebar.tak'),
15-
...require('./src/sidebars/windows/sidebar.bl'),
3+
function getItem(item) {
4+
if (item.type === 'category') {
5+
return {
6+
type: 'category',
7+
label: item.label,
8+
items: item.items.map(getItem),
9+
};
10+
}
11+
if (item.type === 'doc') {
12+
return item.id;
13+
}
14+
return item;
15+
}
1616

17-
// Dev
18-
...require('./src/sidebars/sidebar.dev'),
17+
module.exports = {
18+
tutorialSidebar: sidebarData.items.map(getItem),
1919
};

src/sidebars/index.json

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
{
2+
"items": [
3+
{
4+
"type": "category",
5+
"label": "Android",
6+
"items": [
7+
{
8+
"type": "doc",
9+
"id": "android/deployapp/home"
10+
},
11+
{
12+
"type": "doc",
13+
"id": "android/tak/home"
14+
},
15+
{
16+
"type": "doc",
17+
"id": "android/bl/home"
18+
}
19+
]
20+
},
21+
{
22+
"type": "category",
23+
"label": "iOS",
24+
"items": [
25+
{
26+
"type": "doc",
27+
"id": "ios/deployapp/home"
28+
},
29+
{
30+
"type": "doc",
31+
"id": "ios/tak/home"
32+
},
33+
{
34+
"type": "doc",
35+
"id": "ios/bl/home"
36+
}
37+
]
38+
},
39+
{
40+
"type": "category",
41+
"label": "Windows",
42+
"items": [
43+
{
44+
"type": "doc",
45+
"id": "windows/deployapp/home"
46+
},
47+
{
48+
"type": "doc",
49+
"id": "windows/tak/home"
50+
},
51+
{
52+
"type": "doc",
53+
"id": "windows/bl/home"
54+
}
55+
]
56+
},
57+
{
58+
"type": "category",
59+
"label": "Dev",
60+
"items": [
61+
{
62+
"type": "doc",
63+
"id": "dev/index"
64+
}
65+
]
66+
}
67+
]
68+
}

tina/__generated__/_graphql.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tina/__generated__/_lookup.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tina/__generated__/_schema.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tina/__generated__/client.ts

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tina/__generated__/config.prebuild.jsx

Lines changed: 71 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tina/__generated__/frags.gql

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)