feat: add React UI for rpm.lair.cafe
- Vite + React + SWC + TypeScript SPA with react-router and react-bootstrap - Dark/light/system theme with Bootstrap 5.3 data-bs-theme - Home page with repo setup instructions and copyable code blocks - Package list and detail pages driven by packages.json - Python script to generate packages.json from repodata XML - Nginx config updated for SPA fallback, asset caching, removed autoindex - New deploy-ui workflow triggered on ui/ or nginx config changes, requires runners with nvm label - packages.json generation added to publish job after createrepo_c - Runner setup docs for nvm and sequoia-sq added to readme Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -190,3 +190,12 @@ jobs:
|
||||
run: |
|
||||
ssh "gitea_ci@${RPM_REPO_HOST}" \
|
||||
"cd /var/www/rpm/fedora/${{ matrix.fedora_version }}/x86_64 && createrepo_c --update ."
|
||||
|
||||
- name: Generate packages.json
|
||||
run: |
|
||||
scp script/generate-packages-json.py "gitea_ci@${RPM_REPO_HOST}:/tmp/"
|
||||
ssh "gitea_ci@${RPM_REPO_HOST}" \
|
||||
"python3 /tmp/generate-packages-json.py \
|
||||
--repodata-dir /var/www/rpm/fedora/${{ matrix.fedora_version }}/x86_64/repodata \
|
||||
--output /var/www/rpm/fedora/${{ matrix.fedora_version }}/x86_64/packages.json \
|
||||
--base-url https://rpm.lair.cafe/fedora/${{ matrix.fedora_version }}/x86_64"
|
||||
|
||||
70
.gitea/workflows/deploy-ui.yml
Normal file
70
.gitea/workflows/deploy-ui.yml
Normal file
@@ -0,0 +1,70 @@
|
||||
name: deploy-ui
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
paths:
|
||||
- "ui/**"
|
||||
- "asset/nginx/**"
|
||||
workflow_dispatch: {}
|
||||
|
||||
jobs:
|
||||
build-and-deploy:
|
||||
runs-on:
|
||||
- fedora-43
|
||||
- nvm
|
||||
env:
|
||||
RPM_REPO_HOST: oolon.kosherinata.internal
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Node.js
|
||||
run: |
|
||||
source ~/.nvm/nvm.sh
|
||||
nvm install --lts
|
||||
echo "$(dirname "$(nvm which current)")" >> "$GITHUB_PATH"
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
cd ui
|
||||
npm ci
|
||||
|
||||
- name: Build UI
|
||||
run: |
|
||||
cd ui
|
||||
npm run build
|
||||
|
||||
- name: Set up SSH
|
||||
run: |
|
||||
install --directory --mode 700 ~/.ssh
|
||||
echo "${RSYNC_SSH_KEY}" | install --mode 600 /dev/stdin ~/.ssh/id_ed25519
|
||||
env:
|
||||
RSYNC_SSH_KEY: ${{ secrets.RSYNC_SSH_KEY }}
|
||||
|
||||
- name: Test SSH connectivity
|
||||
run: |
|
||||
ssh -o StrictHostKeyChecking=accept-new "gitea_ci@${RPM_REPO_HOST}" exit
|
||||
|
||||
- name: Deploy UI to web root
|
||||
run: |
|
||||
rsync \
|
||||
--archive \
|
||||
--verbose \
|
||||
--delete \
|
||||
--chmod D755,F644 \
|
||||
--include="index.html" \
|
||||
--include="assets/***" \
|
||||
--exclude="*" \
|
||||
ui/dist/ \
|
||||
"gitea_ci@${RPM_REPO_HOST}:/var/www/rpm/"
|
||||
|
||||
- name: Deploy nginx config
|
||||
run: |
|
||||
rsync \
|
||||
--archive \
|
||||
--verbose \
|
||||
--rsync-path="sudo rsync" \
|
||||
--chown=root:root \
|
||||
asset/nginx/rpm.lair.cafe.conf \
|
||||
"gitea_ci@${RPM_REPO_HOST}:/etc/nginx/sites-available/rpm.lair.cafe.conf"
|
||||
ssh "gitea_ci@${RPM_REPO_HOST}" "sudo nginx -t && sudo systemctl reload nginx"
|
||||
Reference in New Issue
Block a user