this repo has no description
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

chore: use reusable deploy workflow from dots

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

+9 -62
+9 -62
.github/workflows/deploy.yaml
··· 2 2 3 3 on: 4 4 push: 5 - branches: 6 - - main 5 + branches: [main] 7 6 workflow_dispatch: 8 7 9 8 jobs: 10 9 deploy: 11 - runs-on: ubuntu-latest 12 - steps: 13 - - uses: actions/checkout@v3 14 - 15 - - name: Setup Tailscale 16 - uses: tailscale/github-action@v3 17 - with: 18 - oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }} 19 - oauth-secret: ${{ secrets.TS_OAUTH_SECRET }} 20 - tags: tag:ci 21 - use-cache: "true" 22 - 23 - - name: Configure SSH 24 - run: | 25 - mkdir -p ~/.ssh 26 - echo "StrictHostKeyChecking no" >> ~/.ssh/config 27 - 28 - - name: Deploy to server 29 - run: | 30 - ssh hn-alerts@terebithia << 'EOF' 31 - cd /var/lib/hn-alerts/app 32 - git fetch --all 33 - git reset --hard origin/main 34 - bun install 35 - sudo /run/current-system/sw/bin/systemctl restart hn-alerts.service 36 - EOF 37 - 38 - - name: Wait for service to start 39 - run: sleep 10 40 - 41 - - name: Health check 42 - run: | 43 - HEALTH_URL="https://hn.dunkirk.sh/health" 44 - MAX_RETRIES=6 45 - RETRY_DELAY=5 46 - 47 - for i in $(seq 1 $MAX_RETRIES); do 48 - echo "Health check attempt $i/$MAX_RETRIES..." 49 - 50 - RESPONSE=$(curl -s -w "\n%{http_code}" "$HEALTH_URL" || echo "000") 51 - HTTP_CODE=$(echo "$RESPONSE" | tail -n1) 52 - BODY=$(echo "$RESPONSE" | sed '$d') 53 - 54 - if [ "$HTTP_CODE" = "200" ]; then 55 - echo "✅ Service is healthy" 56 - echo "$BODY" 57 - exit 0 58 - fi 59 - 60 - echo "❌ Health check failed with HTTP $HTTP_CODE" 61 - echo "$BODY" 62 - 63 - if [ $i -lt $MAX_RETRIES ]; then 64 - echo "Retrying in ${RETRY_DELAY}s..." 65 - sleep $RETRY_DELAY 66 - fi 67 - done 68 - 69 - echo "❌ Health check failed after $MAX_RETRIES attempts" 70 - exit 1 10 + uses: taciturnaxolotl/dots/.github/workflows/deploy-service.yml@main 11 + with: 12 + service: hn-alerts 13 + health_url: https://hn.dunkirk.sh/health 14 + db_path: /var/lib/hn-alerts/data/hn-alerts.db 15 + secrets: 16 + TS_OAUTH_CLIENT_ID: ${{ secrets.TS_OAUTH_CLIENT_ID }} 17 + TS_OAUTH_SECRET: ${{ secrets.TS_OAUTH_SECRET }}