forked from madebygps/vscode-github-copilot-agent-lab
-
Notifications
You must be signed in to change notification settings - Fork 18
82 lines (63 loc) · 2.11 KB
/
deploy.yml
File metadata and controls
82 lines (63 loc) · 2.11 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
80
81
82
name: Deploy to GitHub Pages
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: 'pages'
cancel-in-progress: true
jobs:
build-and-deploy:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Install dependencies
run: uv sync --no-dev
- name: Prepare deployment
run: |
# Create _site directory
mkdir -p ./_site/app/static
# Copy docs (workshop walkthrough) to root
cp -r docs/* ./_site/
# Copy static assets
cp -r app/static/* ./_site/app/static/
# Render the start screen as a static page for GitHub Pages
uv run python -c "
from jinja2 import Environment, FileSystemLoader
from app.models import GameState
from app.game_service import GameSession
env = Environment(loader=FileSystemLoader('app/templates'))
# For static deploy, we need a self-contained HTML file
session = GameSession()
# Render home.html (extends base.html, so produces full page)
template = env.get_template('home.html')
full_html = template.render(
session=session,
GameState=GameState,
url_for=lambda name, path='': f'/agent-lab-python/app/static/{path}' if name == 'static' else path,
)
with open('_site/app/index.html', 'w') as f:
f.write(full_html)
"
# Prevent Jekyll processing
touch ./_site/.nojekyll
- uses: actions/configure-pages@v4
- uses: actions/upload-pages-artifact@v3
with:
path: _site
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4