mirror of
https://github.com/zkldi/Tachi.git
synced 2026-10-04 04:48:15 +03:00
92 lines
2.6 KiB
YAML
92 lines
2.6 KiB
YAML
name: Seeds Web UI
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- "main"
|
|
paths:
|
|
- "typescript/seeds-webui/**"
|
|
- "typescript/common/**"
|
|
- "db/seeds/**"
|
|
- ".github/workflows/seeds-webui.yml"
|
|
pull_request:
|
|
branches:
|
|
- "main"
|
|
paths:
|
|
- "typescript/seeds-webui/**"
|
|
- "typescript/common/**"
|
|
- "db/seeds/**"
|
|
- ".github/workflows/seeds-webui.yml"
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: ghcr.io/zkldi/tachi-dev:main
|
|
options: --user root
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Install dependencies
|
|
run: bun install --frozen-lockfile
|
|
|
|
- name: Lint
|
|
run: bun run --filter tachi-seeds-webui lint
|
|
|
|
- name: Typecheck
|
|
run: bun run --filter tachi-seeds-webui typecheck
|
|
|
|
- name: Production build
|
|
run: bun run --filter tachi-seeds-webui build
|
|
env:
|
|
VITE_SEEDS_REPO: zkldi/Tachi3
|
|
BUILD_OUT_DIR: /tmp/seeds-webui
|
|
|
|
- name: Bundle build output
|
|
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
|
|
run: tar -C /tmp -czf seeds-webui.tgz seeds-webui
|
|
|
|
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
|
|
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
|
|
with:
|
|
name: seeds-webui
|
|
path: seeds-webui.tgz
|
|
retention-days: 1
|
|
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
needs: build
|
|
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
|
|
steps:
|
|
- name: Install rsync
|
|
run: sudo apt-get update && sudo apt-get install -y rsync
|
|
|
|
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
|
|
with:
|
|
name: seeds-webui
|
|
|
|
- name: Unpack build output
|
|
run: tar -C /tmp -xzf seeds-webui.tgz
|
|
|
|
- name: Enable SSH
|
|
env:
|
|
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
|
|
SSH_KNOWN_HOSTS: ${{ secrets.SSH_KNOWN_HOSTS }}
|
|
run: |
|
|
mkdir -p ~/.ssh
|
|
printf '%s' "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa
|
|
chmod 600 ~/.ssh/id_rsa
|
|
printf '%s' "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
|
|
|
|
- name: Deploy static to seeds.tachi.ac root
|
|
env:
|
|
TACHI_HOST: ${{ secrets.TACHI_HOST }}
|
|
run: rsync --recursive --compress --delete --progress /tmp/seeds-webui/. "ci@${TACHI_HOST}:/srv/tachi-static/seeds/"
|