This repository has been archived on 2025-11-09. You can view files and clone it, but cannot push or open issues or pull requests.
Files
trafficcue-client/.gitea/workflows/2-cd.yml
Jannik d1e86ce174
All checks were successful
TrafficCue CI / check (push) Successful in 1m27s
TrafficCue CI / build (push) Successful in 1m43s
style: run prettier
2025-09-06 18:37:38 +02:00

45 lines
1.3 KiB
YAML

name: TrafficCue CI
on:
push:
branches: [main, staging]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: latest
- uses: oven-sh/setup-bun@v2
- name: Install dependencies
run: bun i
- run: bun run build
- name: Upload build artifact
uses: actions/upload-artifact@v3
with:
name: dist
path: dist/
- name: Install rsync
run: sudo apt-get update && sudo apt-get install -y rsync
- name: Deploy build
env:
DEPLOY_USER: ${{ secrets.DEPLOY_USER }}
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }}
DEPLOY_PATH_MAIN: ${{ secrets.DEPLOY_PATH_MAIN }}
DEPLOY_PATH_STAGING: ${{ secrets.DEPLOY_PATH_STAGING }}
SSH_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
run: |
echo "$SSH_KEY" > private_key
chmod 600 private_key
if [ "${GITEA_REF##*/}" = "main" ]; then
TARGET_PATH=$DEPLOY_PATH_MAIN
else
TARGET_PATH=$DEPLOY_PATH_STAGING
fi
rsync -avz -e "ssh -i private_key -o StrictHostKeyChecking=no" dist/ $DEPLOY_USER@$DEPLOY_HOST:$TARGET_PATH/
rm private_key