From dae1eba8a1706483ed045d2373a89a65fcfb9889 Mon Sep 17 00:00:00 2001 From: Kieran Klukas Date: Fri, 6 Mar 2026 15:01:09 -0500 Subject: [PATCH] chore: use reusable deploy workflow from dots Co-Authored-By: Claude Opus 4.6 --- .github/workflows/deploy-traverse.yaml | 66 -------------------------- .github/workflows/deploy.yaml | 17 +++++++ 2 files changed, 17 insertions(+), 66 deletions(-) delete mode 100644 .github/workflows/deploy-traverse.yaml create mode 100644 .github/workflows/deploy.yaml diff --git a/.github/workflows/deploy-traverse.yaml b/.github/workflows/deploy-traverse.yaml deleted file mode 100644 index 0809790..0000000 --- a/.github/workflows/deploy-traverse.yaml +++ /dev/null @@ -1,66 +0,0 @@ -name: Deploy Traverse - -on: - push: - branches: - - main - workflow_dispatch: - -jobs: - deploy: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Setup Tailscale - uses: tailscale/github-action@v3 - with: - oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }} - oauth-secret: ${{ secrets.TS_OAUTH_SECRET }} - tags: tag:ci - use-cache: "true" - - - name: Configure SSH - run: | - mkdir -p ~/.ssh - echo "StrictHostKeyChecking no" >> ~/.ssh/config - - - name: Deploy to server - run: | - ssh traverse@terebithia << 'EOF' - cd /var/lib/traverse/app - git fetch --all - git reset --hard origin/main - bun install - sudo /run/current-system/sw/bin/systemctl restart traverse.service - EOF - - - name: Wait for service to start - run: sleep 10 - - - name: Health check - run: | - HEALTH_URL="https://traverse.dunkirk.sh" - MAX_RETRIES=6 - RETRY_DELAY=5 - - for i in $(seq 1 $MAX_RETRIES); do - echo "Health check attempt $i/$MAX_RETRIES..." - - HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" "$HEALTH_URL" || echo "000") - - if [ "$HTTP_CODE" = "200" ]; then - echo "✅ Service is healthy" - exit 0 - fi - - echo "❌ Health check failed with HTTP $HTTP_CODE" - - if [ $i -lt $MAX_RETRIES ]; then - echo "Retrying in ${RETRY_DELAY}s..." - sleep $RETRY_DELAY - fi - done - - echo "❌ Health check failed after $MAX_RETRIES attempts" - exit 1 diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml new file mode 100644 index 0000000..707c73b --- /dev/null +++ b/.github/workflows/deploy.yaml @@ -0,0 +1,17 @@ +name: Deploy Traverse + +on: + push: + branches: [main] + workflow_dispatch: + +jobs: + deploy: + uses: taciturnaxolotl/dots/.github/workflows/deploy-service.yml@main + with: + service: traverse + health_url: https://traverse.dunkirk.sh + db_path: /var/lib/traverse/data/traverse.db + secrets: + TS_OAUTH_CLIENT_ID: ${{ secrets.TS_OAUTH_CLIENT_ID }} + TS_OAUTH_SECRET: ${{ secrets.TS_OAUTH_SECRET }} -- 2.51.2