Sync local Vercel project state #2
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 9Ruby Home | |
| on: | |
| push: | |
| branches: [main] | |
| jobs: | |
| build-and-deploy: | |
| name: Build & Deploy | |
| runs-on: ubuntu-latest | |
| env: | |
| VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} | |
| VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | |
| VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Cache node_modules | |
| uses: actions/cache@v4 | |
| id: cache-node-modules | |
| with: | |
| path: node_modules | |
| key: ${{ runner.os }}-node-modules-${{ hashFiles('package-lock.json', 'yarn.lock', 'pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-node-modules- | |
| - name: Install dependencies | |
| if: steps.cache-node-modules.outputs.cache-hit != 'true' | |
| run: npm ci | |
| - name: Type check and build | |
| run: npm run build | |
| - name: Install Vercel CLI | |
| run: npm install -g vercel | |
| - name: Pull Vercel environment | |
| run: vercel pull --yes --environment=production --token=$VERCEL_TOKEN | |
| - name: Deploy to Vercel Production | |
| run: vercel deploy --prod --token=$VERCEL_TOKEN | |
| notify: | |
| name: Notification | |
| needs: build-and-deploy | |
| runs-on: ubuntu-latest | |
| if: always() | |
| steps: | |
| - name: Send deployment notification | |
| run: | | |
| if [ "${{ needs.build-and-deploy.result }}" == "success" ]; then | |
| echo "Deployment successful: 9Ruby Home has been deployed to production." | |
| else | |
| echo "Deployment failed: 9Ruby Home deployment encountered an error." | |
| fi |