Deploy Extensions CDN #5
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 Extensions CDN | |
| on: | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| jobs: | |
| deploy: | |
| if: github.repository == 'athasdev/extensions' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Deploy via SSH | |
| uses: appleboy/ssh-action@v1.0.3 | |
| with: | |
| host: ${{ secrets.VPS_HOST }} | |
| username: ${{ secrets.VPS_USER }} | |
| key: ${{ secrets.VPS_SSH_KEY }} | |
| port: ${{ secrets.VPS_PORT || 22 }} | |
| envs: EXTENSIONS_CDN_ROOT | |
| script: | | |
| set -e | |
| if [ ! -d /srv/extensions/.git ]; then | |
| git clone --depth 1 https://github.com/athasdev/extensions.git /srv/extensions | |
| fi | |
| git config --global --add safe.directory /srv/extensions | |
| cd /srv/extensions | |
| git stash push --include-untracked --message "auto-deploy-$(date +%s)" || true | |
| git pull --ff-only origin master | |
| /root/.bun/bin/bun scripts/build-extensions-index.ts | |
| /root/.bun/bin/bun scripts/generate-manifests.ts | |
| if [ -n "${EXTENSIONS_CDN_ROOT:-}" ]; then | |
| /root/.bun/bin/bun scripts/deploy-extensions-cdn.ts | |
| else | |
| echo "EXTENSIONS_CDN_ROOT not set, skipping extensions CDN sync." | |
| fi | |
| env: | |
| EXTENSIONS_CDN_ROOT: ${{ secrets.EXTENSIONS_CDN_ROOT }} |