Skip to content

Update dependency marked to v17 #243

Update dependency marked to v17

Update dependency marked to v17 #243

Workflow file for this run

name: Build and Deploy
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.14'
- name: Install Python dependencies
run: |
cd build
pip install -r requirements.txt
- name: Download SQLite database from server
run: |
# Setup SSH client
mkdir -p ~/.ssh
echo "${{ secrets.PRIVATE_SERVER_SSH_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -H ${{ secrets.PRIVATE_SERVER_HOST }} >> ~/.ssh/known_hosts
# Download database file
scp -P ${{ secrets.PRIVATE_SERVER_PORT || 22 }} \
${{ secrets.PRIVATE_SERVER_USER }}@${{ secrets.PRIVATE_SERVER_HOST }}:${{ secrets.SQLITE_DB_PATH }} \
./database.db
# Verify downloaded file
if [ ! -f "./database.db" ]; then
echo "Failed to download database file"
exit 1
fi
- name: Extract tweets from SQLite
run: |
cd build
python sql_extraction.py \
--db-path ../database.db \
--tweet-table tweet \
--output-dir ../src/content/tweets
- name: Install Node.js dependencies
run: npm ci
- name: Build Astro site
run: npm run build
- name: Deploy to server
if: github.ref == 'refs/heads/main'
uses: appleboy/scp-action@v1.0.0
with:
host: ${{ secrets.DEPLOY_HOST }}
username: ${{ secrets.DEPLOY_USER }}
key: ${{ secrets.DEPLOY_SSH_KEY }}
port: ${{ secrets.DEPLOY_PORT || 22 }}
source: ./dist/*
target: ${{ secrets.DEPLOY_PATH }}
strip_components: 1
overwrite: true