resize svbony-powerbox image #69
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy Astro Documentation | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: "18" | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Copy driver thumbnails to public directory | |
| run: | | |
| mkdir -p public/images/drivers | |
| find src/content/docs -type f -name "*.webp" ! -path "*/images/*" | while read file; do | |
| # Extract manufacturer and driver from path | |
| # Path format: src/content/docs/category/manufacturer/driver/driver.webp | |
| manufacturer=$(echo "$file" | cut -d'/' -f5) | |
| driver=$(basename "$file" .webp) | |
| mkdir -p "public/images/drivers/$manufacturer" | |
| cp "$file" "public/images/drivers/$manufacturer/$driver.webp" | |
| echo "Copied: $file -> public/images/drivers/$manufacturer/$driver.webp" | |
| done | |
| - name: Build Astro project | |
| run: npm run build | |
| - name: rsync deployments | |
| uses: burnett01/rsync-deployments@7.1.0 | |
| with: | |
| switches: -azv --delete | |
| path: dist/ | |
| remote_path: public_html/ | |
| remote_host: ${{ secrets.REMOTE_HOST }} | |
| remote_user: ${{ secrets.REMOTE_USER }} | |
| remote_key: ${{ secrets.REMOTE_PRIVATE_KEY }} |