Skip to content

Commit 29c50af

Browse files
authored
Merge pull request #36 from spinframework/ci/deploy-site
ci(.github): add deploy.yaml
2 parents 1b55c26 + bd22d3d commit 29c50af

File tree

2 files changed

+63
-0
lines changed

2 files changed

+63
-0
lines changed

.github/workflows/build.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: Build
22
on:
33
pull_request:
44
branches: [main]
5+
workflow_call:
56

67
env:
78
BART_VERSION: v0.10.0
@@ -51,3 +52,21 @@ jobs:
5152
- name: Run npm tests
5253
run: |
5354
npm test
55+
56+
- name: Archive app artifacts
57+
uses: actions/upload-artifact@v4
58+
with:
59+
name: app
60+
# These are all of the paths referenced in spin.toml
61+
path: |
62+
spin.toml
63+
modules/*.wasm
64+
content/**/*
65+
templates/*
66+
scripts/*
67+
config/*
68+
shortcodes/*
69+
static/**/*
70+
downloads/**/*
71+
spin-redirect.json
72+
spin-up-hub/dist/**/*

.github/workflows/deploy.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Deploy Spin Docs
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
8+
workflow_dispatch:
9+
10+
# Construct a concurrency group to be shared across workflow runs.
11+
# The default behavior ensures that only one is running at a time, with
12+
# all others queuing and thus not interrupting runs that are in-flight.
13+
concurrency: ${{ github.workflow }}
14+
15+
permissions:
16+
contents: read
17+
18+
jobs:
19+
build:
20+
uses: ./.github/workflows/build.yaml
21+
22+
deploy:
23+
runs-on: ubuntu-24.04
24+
needs: build
25+
steps:
26+
- name: Download build artifacts
27+
uses: actions/download-artifact@v4
28+
with:
29+
name: app
30+
path: "${{ github.workspace }}"
31+
32+
- name: Setup Spin
33+
uses: fermyon/actions/spin/setup@v1
34+
with:
35+
github_token: ${{ secrets.GITHUB_TOKEN }}
36+
37+
- name: Login to Fermyon Cloud
38+
run: spin cloud login --token "${{ secrets.FERMYON_CLOUD_TOKEN }}"
39+
40+
- name: Deploy to Fermyon Cloud
41+
uses: fermyon/actions/spin/deploy@v1
42+
with:
43+
run_build: false
44+
fermyon_token: "${{ secrets.FERMYON_CLOUD_TOKEN }}"

0 commit comments

Comments
 (0)