diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index ee6f288..43fc366 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -26,8 +26,8 @@ jobs: debug: true switches: -avzr --delete path: dist/ - remote_path: /opt/stacks/dong-site/dist/ # ex: /var/www/html/ - remote_host: ${{ secrets.DEPLOY_HOST }} # ex: example.com - remote_port: ${{ secrets.DEPLOY_SSH_PORT }} # ex: 22 - remote_user: ${{ secrets.DEPLOY_USER }} # ex: ubuntu + remote_path: /opt/stacks/dong-site/dist/ + remote_host: ${{ secrets.DEPLOY_HOST }} + remote_port: ${{ secrets.DEPLOY_SSH_PORT }} + remote_user: ${{ secrets.DEPLOY_USER }} remote_key: ${{ secrets.DEPLOY_SSH_PRIVATE_KEY }} \ No newline at end of file diff --git a/AGENTS.md b/AGENTS.md index 7cb869c..5576a38 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -80,6 +80,10 @@ src/ - No CSS library — plain CSS with variables for theming - `#main-content` in Layout has `style={{ flex: 1 }}` (parent `#root` is `display: flex; flex-direction: column`) +## Deployment + +- Deployment is triggered automatically by gitea workflow `.gitea/workflows/deploy.yml`setup in the repository. + ## Known Issues & Gotchas 1. **React Router v8 routing:** Use `...`, NOT `}>` with nested routes — the latter doesn't pass `children` correctly diff --git a/README.md b/README.md index d6af7e3..efe84ce 100644 --- a/README.md +++ b/README.md @@ -28,5 +28,35 @@ If you are developing a production application, we recommend enabling type-aware } } ``` - See the [Oxlint rules documentation](https://oxc.rs/docs/guide/usage/linter/rules) for the full list of rules and categories. + +## Deployment On Windows + +Open PowerShell on your Windows computer. + +Create an ssh key for gitea deployment: + +```powershell +ssh-keygen -t ed25519 -C "gitea-deploy" -f "$HOME\.ssh\gitea_deploy_key" +``` + +In a VPS server, create the deployment user + +```bash +sudo adduser gitea-deployer +sudo install -d -m 700 -o deploy -g deploy /home/gitea-deployer/.ssh +``` + +Because no ssh-copy-id is available on Windows, you need to copy the public key to the server manually. + +```powershell +type $HOME\.ssh\gitea_deploy_key.pub | ssh gitea-deployer@112.213.91.239 -p 2212 "cat >> ~/.ssh/authorized_keys" +``` + +Test ssh connected with a private key + +```powershell +ssh gitea-deployer@112.213.91.239 -p 2212 -i "$HOME\.ssh\gitea_deploy_key" -o IdentitiesOnly=yes +``` + +