Skip to content

Commit d2cbdc5

Browse files
authored
Merge pull request #335 from spinframework/feat/docs
[docs]: Add versioned docs for Spin JS SDK
2 parents dacc612 + b4ff1a7 commit d2cbdc5

File tree

94 files changed

+299
-2464
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+299
-2464
lines changed

.github/workflows/release.yaml

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- "v*"
9+
workflow_dispatch:
10+
11+
env:
12+
NODE_VERSION: "22"
13+
14+
jobs:
15+
lint_and_test:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v3
19+
- name: Install Node.js
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: ${{ env.NODE_VERSION }}
23+
- name: Install Dependencies
24+
shell: bash
25+
run: npm install
26+
- name: Run prettier check
27+
shell: bash
28+
run: npm run fmt-check
29+
- name: Install latest Spin CLI
30+
uses: fermyon/actions/spin/setup@v1
31+
with:
32+
github_token: ${{ secrets.GITHUB_TOKEN }}
33+
- name: Run Test
34+
shell: bash
35+
run: |
36+
cd test
37+
./test.sh
38+
39+
test_template:
40+
runs-on: ${{ matrix.os }}
41+
strategy:
42+
matrix:
43+
os: [ubuntu-latest, macos-latest, windows-latest]
44+
steps:
45+
- name: Checkout Repository
46+
uses: actions/checkout@v3
47+
- name: Install Node.js
48+
uses: actions/setup-node@v3
49+
with:
50+
node-version: ${{ env.NODE_VERSION }}
51+
- name: Install latest Spin CLI
52+
uses: fermyon/actions/spin/setup@v1
53+
with:
54+
github_token: ${{ secrets.GITHUB_TOKEN }}
55+
- name: Install templates
56+
run: spin templates install --dir .
57+
- name: Create new project
58+
run: spin new -t http-ts test-project -a
59+
- name: Install dependencies of the test project
60+
run: |
61+
cd test-project
62+
npm install
63+
- name: Add new component to project
64+
run: |
65+
cd test-project
66+
spin add -t http-ts new-component -a
67+
cd new-component
68+
npm install
69+
- name: Build the application
70+
run: |
71+
cd test-project
72+
spin build
73+
build_docs:
74+
runs-on: ubuntu-latest
75+
needs: lint_and_test # later we want this after publishing to npmjs
76+
steps:
77+
- name: Checkout Repository including Tags
78+
uses: actions/checkout@v4
79+
- name: Fetch Git tags
80+
run: git fetch --tags
81+
- name: Install Node.js
82+
uses: actions/setup-node@v3
83+
with:
84+
node-version: ${{ env.NODE_VERSION }}
85+
- name: Generate Spin JS SDK Docs
86+
run: |
87+
./scripts/build-docs.sh
88+
- name: Upload Spin JS SDK Docs as Artifact
89+
id: docs_deployment
90+
uses: actions/upload-pages-artifact@v3
91+
with:
92+
path: docs/
93+
deploy_docs:
94+
if: (startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch')
95+
permissions:
96+
pages: write
97+
environment:
98+
name: github-pages
99+
url: ${{ steps.docs_deployment.outputs.page_url }}
100+
runs-on: ubuntu-latest
101+
needs: build_docs
102+
steps:
103+
- name: Deploy to GitHub Pages
104+
id: docs_deployment
105+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ target/
55
combined-wit/
66
dist.js
77
dist/
8-
build/
8+
build/
9+
docs/

docs/.nojekyll

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/assets/highlight.css

Lines changed: 0 additions & 22 deletions
This file was deleted.

docs/assets/icons.js

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)