Repository navigation
79 lines (68 loc) · 2.71 KB
/
Copy pathdocs-deploy-github-pages.yml
File metadata and controls
79 lines (68 loc) · 2.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: "Docs: Deploy to GitHub Pages"
on:
workflow_dispatch:
inputs:
skip_changelog_check:
description: 'Deploy even if a published release has no changelog entry yet'
type: boolean
default: false
permissions:
contents: write
defaults:
run:
working-directory: site
jobs:
deploy:
runs-on: strands-agents_ubuntu-latest_4-core
steps:
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Set up Node.js
uses: actions/setup-node@v7
with:
node-version: '22'
- name: Install dependencies
run: npm ci
# Releases must ship with their changelog: merge the open
# "docs(changelog): sync release notes" PR first (see CHANGELOG-SYNC.md).
- name: Check every release has a changelog entry
if: ${{ !inputs.skip_changelog_check }}
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
missing=0 unverified=0
for repo in strands-agents/harness-sdk strands-agents/evals strands-agents/box; do
code=0
npm run -s changelog:sync -- --check --source-repo "$repo" || code=$?
if [ "$code" = 1 ]; then missing=1; elif [ "$code" != 0 ]; then unverified=1; fi
done
if [ "$missing" = 1 ]; then
echo "::error::Merge the open changelog PR before deploying: https://github.com/strands-agents/harness-sdk/pulls?q=is%3Apr+is%3Aopen+head%3Achangelog%2Fsync"
fi
if [ "$unverified" = 1 ]; then
echo "::error::Could not list releases from GitHub; re-run the deploy, or check skip_changelog_check if the API is down."
fi
[ "$missing" = 0 ] && [ "$unverified" = 0 ]
- name: Build CMS
run: npm run cms:build
env:
SITE_DOMAIN: https://strandsagents.com
- name: Create latest/ symlinks for llms.txt files
run: |
mkdir -p dist/latest
ln dist/llms.txt dist/latest/llms.txt
ln dist/llms-full.txt dist/latest/llms-full.txt
- name: Deploy to gh-pages branch
working-directory: .
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
git fetch origin gh-pages || true
git worktree add gh-pages-deploy origin/gh-pages 2>/dev/null || git worktree add --orphan -b gh-pages gh-pages-deploy
rsync -a --delete --exclude='.git' --exclude='CNAME' site/dist/ gh-pages-deploy/
cd gh-pages-deploy
git add -A
git diff --cached --quiet || git commit -m "Deploy to GitHub Pages from ${{ github.sha }}"
git push origin HEAD:gh-pages