Skip to content

[docs]: Add versioned docs for Spin JS SDK #335

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Feb 17, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
105 changes: 105 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: Release

on:
push:
branches:
- main
tags:
- "v*"
workflow_dispatch:

env:
NODE_VERSION: "22"

jobs:
lint_and_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install Dependencies
shell: bash
run: npm install
- name: Run prettier check
shell: bash
run: npm run fmt-check
- name: Install latest Spin CLI
uses: fermyon/actions/spin/setup@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Run Test
shell: bash
run: |
cd test
./test.sh

test_template:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install latest Spin CLI
uses: fermyon/actions/spin/setup@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Install templates
run: spin templates install --dir .
- name: Create new project
run: spin new -t http-ts test-project -a
- name: Install dependencies of the test project
run: |
cd test-project
npm install
- name: Add new component to project
run: |
cd test-project
spin add -t http-ts new-component -a
cd new-component
npm install
- name: Build the application
run: |
cd test-project
spin build
build_docs:
runs-on: ubuntu-latest
needs: lint_and_test # later we want this after publishing to npmjs
steps:
- name: Checkout Repository including Tags
uses: actions/checkout@v4
- name: Fetch Git tags
run: git fetch --tags
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Generate Spin JS SDK Docs
run: |
./scripts/build-docs.sh
- name: Upload Spin JS SDK Docs as Artifact
id: docs_deployment
uses: actions/upload-pages-artifact@v3
with:
path: docs/
deploy_docs:
if: (startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch')
permissions:
pages: write
environment:
name: github-pages
url: ${{ steps.docs_deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build_docs
steps:
- name: Deploy to GitHub Pages
id: docs_deployment
uses: actions/deploy-pages@v4
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ target/
combined-wit/
dist.js
dist/
build/
build/
docs/
1 change: 0 additions & 1 deletion docs/.nojekyll

This file was deleted.

22 changes: 0 additions & 22 deletions docs/assets/highlight.css

This file was deleted.

18 changes: 0 additions & 18 deletions docs/assets/icons.js

This file was deleted.

Loading