Skip to content

Update dependency astro to v5.15.9 #276

Update dependency astro to v5.15.9

Update dependency astro to v5.15.9 #276

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: Create custom.config.mjs from secret
env:
CUSTOM_CONFIG: ${{ secrets.CUSTOM_CONFIG }}
run: |
if [ -n "$CUSTOM_CONFIG" ]; then
echo "$CUSTOM_CONFIG" > custom.config.mjs
echo "custom.config.mjs created from secret"
else
echo "CUSTOM_CONFIG secret not set, skipping custom.config.mjs creation"
fi
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '24'
cache: 'npm'
- name: Setup Python
uses: actions/setup-python@v6
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/[email protected]
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