añadiendo vista y logica del sorteo #20
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: CI/CD Pipeline for TuRifa | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
workflow_dispatch: | |
env: | |
APP_NAME: "turifa" | |
NODE_VERSION: "18" | |
jobs: | |
frontend: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./client | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: Install frontend dependencies | |
run: npm install | |
- name: Lint with ESLint | |
run: npm run lint | |
continue-on-error: true | |
- name: Run frontend tests | |
run: npm run test | |
env: | |
CI: true | |
VITE_APIKEY: ${{ secrets.VITE_APIKEY }} | |
VITE_AUTHDOMAIN: ${{ secrets.VITE_AUTHDOMAIN }} | |
VITE_PROJECTID: ${{ secrets.VITE_PROJECTID }} | |
VITE_STORAGE_BUCKET: ${{ secrets.VITE_STORAGE_BUCKET }} | |
VITE_MESSAGING_SENDER_ID: ${{ secrets.VITE_MESSAGING_SENDER_ID }} | |
VITE_APP_ID: ${{ secrets.VITE_APP_ID }} | |
- name: Build frontend | |
run: npm run build | |
env: | |
CI: true | |
- name: Deploy to Vercel | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
run: npx vercel --prod --token ${{ secrets.VERCEL_TOKEN }} | |
env: | |
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | |
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | |
backend: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./backend | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: Install backend dependencies | |
run: npm install | |
- name: Lint with ESLint | |
run: npm run lint | |
continue-on-error: true | |
- name: Run backend tests | |
run: npm run test:ci | |
env: | |
CI: true | |
- name: Deploy to Render | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
uses: JorgeLNJunior/[email protected] | |
with: | |
service-id: ${{ secrets.RENDER_SERVICE_ID }} | |
api-key: ${{ secrets.RENDER_API_KEY }} | |
clear-cache: false |