The gitea_ci user cannot set timestamps on /var/www/rpm/ which is owned by root. Directory timestamps are irrelevant for static files. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
73 lines
1.8 KiB
YAML
73 lines
1.8 KiB
YAML
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: |
|
|
export NVM_DIR="${HOME}/.nvm"
|
|
[ -s "${NVM_DIR}/nvm.sh" ] && . "${NVM_DIR}/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 \
|
|
--omit-dir-times \
|
|
--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"
|