update fdx #1
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 Auth to VM | |
| on: | |
| push: | |
| paths: | |
| - 'apps/auth/**' | |
| - 'apps/shared/**' | |
| - 'pnpm-lock.yaml' | |
| - 'pnpm-workspace.yaml' | |
| - 'package.json' | |
| workflow_dispatch: | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| # Install pnpm per docs; version comes from package.json "packageManager" | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| run_install: false | |
| - name: Setup Node 22 (enable pnpm cache) | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22.x' | |
| cache: 'pnpm' | |
| cache-dependency-path: pnpm-lock.yaml | |
| - name: Install deps | |
| run: pnpm install --frozen-lockfile | |
| - name: Build shared library | |
| run: cd apps/shared && pnpm exec tsc -b | |
| - name: Build Auth CSS | |
| run: cd apps/auth && pnpm exec npm run css:build | |
| - name: Build Auth | |
| run: cd apps/auth && pnpm exec tsc -b | |
| - name: Create deploy bundle | |
| run: pnpm deploy --prod --legacy --filter "{apps/auth}" out/auth | |
| - name: Rsync to VM | |
| uses: burnett01/[email protected] | |
| with: | |
| switches: -az --delete --exclude='.env' --exclude='.env.clients.json' | |
| path: out/auth/ | |
| remote_path: /srv/apps/auth/ | |
| remote_host: ${{ secrets.VM_HOST }} | |
| remote_user: deploy | |
| remote_key: ${{ secrets.VM_SSH_KEY }} | |
| - name: Restart service | |
| uses: appleboy/[email protected] | |
| with: | |
| host: ${{ secrets.VM_HOST }} | |
| username: deploy | |
| key: ${{ secrets.VM_SSH_KEY }} | |
| script: sudo systemctl restart plaidypus-auth |