generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 197
48 lines (39 loc) · 1.35 KB
/
deploy-github-pages.yml
File metadata and controls
48 lines (39 loc) · 1.35 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
name: Deploy to GitHub Pages
on:
workflow_dispatch:
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Install dependencies
run: npm install
- 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
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' 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