Files
zkldi_Tachi/.github/workflows/homepage.yml
T

48 lines
1.3 KiB
YAML

name: Homepage CI/CD
on:
push:
branches:
- "main"
paths:
- "homepage/**"
- ".github/workflows/homepage.yml"
workflow_dispatch:
permissions:
contents: read
jobs:
deploy:
runs-on: ubuntu-latest
container:
image: ghcr.io/zkldi/tachi-dev:main
options: --user root
if: ${{ github.ref == 'refs/heads/main' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch') }}
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Build
run: bun run --filter tachi-homepage build
- 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
env:
TACHI_HOST: ${{ secrets.TACHI_HOST }}
run: rsync --recursive --compress --delete --progress ./homepage/dist/. "ci@${TACHI_HOST}:tachi"