diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..2403019 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,27 @@ +name: CI + +on: + pull_request: + branches: ["main"] + push: + branches: ["main"] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.11" + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + + - name: Run tests + run: pytest -q diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..cac292f --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,31 @@ +name: Release Artifact + +on: + push: + branches: ["main"] + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.11" + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + + - name: Generate site artifact + run: python tools/generate_site.py + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: site-dist + path: dist/index.html diff --git a/app/__init__.py b/app/__init__.py new file mode 100644 index 0000000..36b8e57 --- /dev/null +++ b/app/__init__.py @@ -0,0 +1 @@ +"""App package.""" diff --git a/app/message.py b/app/message.py new file mode 100644 index 0000000..508018b --- /dev/null +++ b/app/message.py @@ -0,0 +1,5 @@ +def render_message(name: str) -> str: + name = (name or "").strip() + if not name: + name = "anonymous" + return f"Hello, {name}!" diff --git a/data/name.txt b/data/name.txt new file mode 100644 index 0000000..2873b8a --- /dev/null +++ b/data/name.txt @@ -0,0 +1 @@ +Yeji diff --git a/dist/index.html b/dist/index.html new file mode 100644 index 0000000..45ae3ff --- /dev/null +++ b/dist/index.html @@ -0,0 +1,20 @@ + + +
+ + +Name: Yeji
+Message: Hello, Yeji!
+Generated at (UTC): 2026-01-15 16:32:49 UTC
+Name: {name}
+Message: {rendered}
+Generated at (UTC): {now}
+