Skip to content
Closed
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
61 changes: 61 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Build
on:
pull_request:
branches: [main]

jobs:
build:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20

- name: Setup Spin
uses: fermyon/actions/spin/setup@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Install bart
run: |
curl -LOs https://github.com/fermyon/bartholomew/releases/download/v0.10.0/bart
chmod +x bart
mv bart /usr/local/bin

- name: Check Docs
run: |
bart check --shortcodes shortcodes content/* && bart check --shortcodes shortcodes content/**/*

- name: Install npm packages
run: |
npm ci
npm ci --prefix ./spin-up-hub

- name: Build app
run: |
spin build

- name: Run npm tests
run: |
npm test

- name: Archive app artifacts
uses: actions/upload-artifact@v4
with:
name: app
# These are all of the paths referenced in spin.toml
path: |
spin.toml
modules/*.wasm
content/**/*
templates/*
scripts/*
config/*
shortcodes/*
static/**/*
downloads/**/*
spin-redirect.json
spin-up-hub/dist/**/*
34 changes: 34 additions & 0 deletions .github/workflows/deploy-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: deploy docs preview
on:
pull_request:
branches: "main"
types: ['opened', 'synchronize', 'reopened', 'closed']

jobs:
deploy-preview:
runs-on: ubuntu-24.04
if: ${{ !github.event.pull_request.head.repo.fork }}
name: Build and deploy
steps:
- uses: actions/checkout@v4

- name: Setup `spin`
uses: fermyon/actions/spin/setup@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Install npm packages
run: |
npm ci
npm ci --prefix ./spin-up-hub

- name: Build app
run: |
spin build

- name: build and deploy preview
uses: fermyon/actions/spin/preview@v1
with:
fermyon_token: ${{ secrets.FERMYON_CLOUD_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
undeploy: ${{ github.event.pull_request && github.event.action == 'closed' }}
44 changes: 44 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Deploy Spin Docs

on:
push:
branches:
- 'main'

workflow_dispatch:

# Construct a concurrency group to be shared across workflow runs.
# The default behavior ensures that only one is running at a time, with
# all others queuing and thus not interrupting runs that are in-flight.
concurrency: ${{ github.workflow }}

permissions:
contents: read

jobs:
build:
uses: ./.github/workflows/build.yml

deploy:
runs-on: ubuntu-24.04
needs: build
steps:
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: app
path: "${{ github.workspace }}"

- name: Setup Spin
uses: fermyon/actions/spin/setup@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Login to Fermyon Cloud
run: spin cloud login --token "${{ secrets.FERMYON_CLOUD_TOKEN }}"

- name: Deploy to Fermyon Cloud
uses: fermyon/actions/spin/deploy@v1
with:
run_build: false
fermyon_token: "${{ secrets.FERMYON_CLOUD_TOKEN }}"
1 change: 0 additions & 1 deletion content/v1/cli-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ $ spin add --help
spin-add
Scaffold a new component into an existing application


USAGE:
spin add [OPTIONS] [ARGS]

Expand Down
2 changes: 0 additions & 2 deletions content/v1/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ enable_shortcodes = true
canonical_url = "https://spinframework.com/v2/index"
url = "https://github.com/spinframework/spin-docs/blob/main/content/spin/v1/index.md"


---

Spin is a framework and CLI for building and running event-driven microservice applications with WebAssembly (Wasm) components. Spin uses Wasm because it is **sandboxed, portable, and fast**. Millisecond cold start times mean no need to keep applications "warm".
Expand All @@ -21,7 +20,6 @@ Many languages have Wasm implementations, so **developers don't have to learn ne
{{card_element "sample" "AI-assisted News Summarizer" "Read an RSS newsfeed and have AI summarize it for you" "/hub/preview/sample_newsreader_ai" "Typescript,Javascript,Ai" true }}
{{blockEnd}}


Or dive into the documentation and get started:

- [Take Spin for a spin](quickstart)
Expand Down
1 change: 0 additions & 1 deletion content/v1/kv-store-api-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ The key value functions are provided through the `spin_key_value` module in the
from spin_http import Response
from spin_key_value import kv_open_default


def handle_request(request):

store = kv_open_default()
Expand Down
2 changes: 0 additions & 2 deletions content/v1/python-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ This next example will create an outbound request, to obtain a random fact about
```python
from spin_http import Request, Response, http_send


def handle_request(request):

response = http_send(
Expand Down Expand Up @@ -273,7 +272,6 @@ from spin_http import Response
from spin_redis import redis_del, redis_get, redis_incr, redis_set, redis_sadd, redis_srem, redis_smembers
from spin_config import config_get


def handle_request(request):

redis_address = config_get("redis_address")
Expand Down
1 change: 0 additions & 1 deletion content/v1/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,6 @@ Hello, Fermyon

Congratulations! You just created, built and ran your first Spin application!


## Next Steps

- Learn more about [writing Spin components and manifests](writing-apps)
Expand Down
1 change: 0 additions & 1 deletion content/v1/serverless-ai-api-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ export const handleRequest: HandleRequest = async function (request: HttpRequest
from spin_http import Response
from spin_llm import llm_infer


def handle_request(request):
prompt="You are a stand up comedy writer. Tell me a joke."
result=llm_infer("llama2-chat", prompt)
Expand Down
1 change: 0 additions & 1 deletion content/v1/serverless-ai-hello-world.md
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,6 @@ def handle_request(request):
except Exception as e:
return Response(500, {"content-type": "text/plain"}, bytes(f"Error: {str(e)}", "utf-8"))


```

{{ blockEnd }}
Expand Down
1 change: 0 additions & 1 deletion content/v2/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ command = "cargo build --target wasm32-wasi --release"

For JavaScript and TypeScript applications, you must have [Node.js](https://nodejs.org).


It's normally convenient to put the detailed build instructions in `package.json`. The build script looks like:

<!-- @nocpy -->
Expand Down
Loading