Compare commits
No commits in common. "aa5c7a999a231d8b82aedb7a6d300ecd5021e200" and "dd2805b7f0586d87b6163bfc18526f0af7c04750" have entirely different histories.
aa5c7a999a
...
dd2805b7f0
3 changed files with 14 additions and 18 deletions
21
.github/workflows/ci.yml
vendored
21
.github/workflows/ci.yml
vendored
|
|
@ -15,6 +15,12 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
|
- name: Print the local dir and list files for debugging
|
||||||
|
run: |
|
||||||
|
echo "Current directory: $(pwd)"
|
||||||
|
echo "Files in current directory:"
|
||||||
|
ls -ahl
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: uv sync --all-extras --dev -U
|
run: uv sync --all-extras --dev -U
|
||||||
|
|
||||||
|
|
@ -26,18 +32,3 @@ jobs:
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: uv run pytest
|
run: uv run pytest
|
||||||
|
|
||||||
# NOTE: The runner must be allowed to run these commands without a password.
|
|
||||||
# sudo EDITOR=nvim visudo
|
|
||||||
# forgejo-runner ALL=(lovinator) NOPASSWD: /usr/bin/git -C /home/lovinator/ANewDawn pull
|
|
||||||
# forgejo-runner ALL=(root) NOPASSWD: /bin/systemctl restart anewdawn.service
|
|
||||||
# forgejo-runner ALL=(lovinator) NOPASSWD: /usr/bin/uv sync -U --all-extras --dev --directory /home/lovinator/ANewDawn
|
|
||||||
- name: Deploy & restart bot (master only)
|
|
||||||
if: ${{ success() && github.ref == 'refs/heads/master' }}
|
|
||||||
run: |
|
|
||||||
# Keep checkout in the Forgejo runner workspace, whatever that is.
|
|
||||||
# actions/checkout already checks out to the runner's working directory.
|
|
||||||
|
|
||||||
sudo -u lovinator git -C /home/lovinator/ANewDawn pull
|
|
||||||
sudo -u lovinator uv sync -U --all-extras --dev --directory /home/lovinator/ANewDawn
|
|
||||||
sudo systemctl restart anewdawn.service
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,11 @@
|
||||||
# Copy this file to /etc/ANewDawn/ANewDawn.env and fill in the required values.
|
# Copy this file to /etc/ANewDawn/ANewDawn.env and fill in the required values.
|
||||||
# Make sure the directory is owned by the user running the service (e.g., "lovinator").
|
# Make sure the directory is owned by the user running the service (e.g., "lovinator").
|
||||||
|
|
||||||
|
# Discord bot token
|
||||||
DISCORD_TOKEN=
|
DISCORD_TOKEN=
|
||||||
|
|
||||||
|
# OpenAI token (for GPT-5 and other OpenAI models)
|
||||||
OPENAI_TOKEN=
|
OPENAI_TOKEN=
|
||||||
OLLAMA_API_KEY=
|
|
||||||
|
# Optional: additional env vars used by your bot
|
||||||
|
# MY_CUSTOM_VAR=
|
||||||
|
|
|
||||||
|
|
@ -10,13 +10,13 @@ User=lovinator
|
||||||
Group=lovinator
|
Group=lovinator
|
||||||
|
|
||||||
# The project directory containing main.py (update as needed).
|
# The project directory containing main.py (update as needed).
|
||||||
WorkingDirectory=/home/lovinator/ANewDawn/
|
WorkingDirectory=/home/lovinator/Code/ANewDawn
|
||||||
|
|
||||||
# Load environment variables (see systemd/anewdawn.env.example).
|
# Load environment variables (see systemd/anewdawn.env.example).
|
||||||
EnvironmentFile=/etc/ANewDawn/ANewDawn.env
|
EnvironmentFile=/etc/ANewDawn/ANewDawn.env
|
||||||
|
|
||||||
# Use the python interpreter from your environment (system python is fine if dependencies are installed).
|
# Use the python interpreter from your environment (system python is fine if dependencies are installed).
|
||||||
ExecStart=/usr/bin/uv run main.py
|
ExecStart=/usr/bin/env python3 main.py
|
||||||
|
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
RestartSec=5
|
RestartSec=5
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue