chore: simplify test (#37) #10
This file contains 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 PROD CI | |
env: | |
VERCEL_ORG_ID: ${{ secrets.VERCEL_TEAM_ID }} | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
deploy-backend: | |
runs-on: ubuntu-latest | |
environment: | |
name: Production – project-management-backend | |
url: ${{ steps.vercel_deploy.outputs.BACKEND_DEPLOYED_URL }} | |
env: | |
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_BACKEND_PROJECT_ID }} | |
defaults: | |
run: | |
working-directory: ./backend | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install Vercel CLI | |
run: npm install --global vercel | |
- name: Deploy Project To Vercel | |
id: vercel_deploy | |
run: | | |
BACKEND_DEPLOYED_URL=$(vercel deploy --yes --prod --token=${{ secrets.VERCEL_API_TOKEN }}) | |
echo "BACKEND_DEPLOYED_URL=$BACKEND_DEPLOYED_URL" >> $GITHUB_OUTPUT | |
deploy-frontend: | |
runs-on: ubuntu-latest | |
needs: deploy-backend | |
environment: | |
name: Production – project-management-frontend | |
url: ${{ steps.vercel_deploy.outputs.FRONT_END_DEPLOYED_URL }} | |
env: | |
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_FRONTEND_PROJECT_ID }} | |
defaults: | |
run: | |
working-directory: ./frontend | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Node.js 20 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: 9.4.0 | |
- name: Install Vercel CLI | |
run: pnpm add --global vercel | |
- name: Deploy Project To Vercel | |
id: vercel_deploy | |
run: | | |
FRONT_END_DEPLOYED_URL=$(vercel deploy --yes --prod --token=${{ secrets.VERCEL_API_TOKEN }}) | |
echo "FRONT_END_DEPLOYED_URL=$FRONT_END_DEPLOYED_URL" >> $GITHUB_OUTPUT |