Skip to content

Commit

Permalink
Modify Deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
cpadlab committed Jan 10, 2025
1 parent 7c887ed commit 93fbf7f
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 13 deletions.
44 changes: 31 additions & 13 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,52 @@
name: Deploy to GitHub Pages
name: Deploy

on:
push:
branches:
- main # O la rama que estés utilizando para desarrollo
- main

jobs:
build:
name: Build
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Checkout repo
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '22'
- name: Setup Node
uses: actions/setup-node@v3

- name: Install dependencies
run: npm install
uses: bahmutov/npm-install@v1

- name: Build the project
- name: Build project
run: npm run build
env:
VITE_BREVO_API_KEY: ${{ secrets.REACT_APP_BREVO_API_KEY }}
VITE_BREVO_CONVERSATIONS_API_KEY: ${{ secrets.REACT_APP_BREVO_CONVERSATIONS_API_KEY }}

- name: Upload production-ready build files
uses: actions/upload-artifact@v3
with:
name: production-files
path: ./dist

deploy:
name: Deploy
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'

steps:
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: production-files
path: ./dist

- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
uses: peaceiris/actions-gh-pages@v3
with:
branch: gh-pages
folder: dist
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
1 change: 1 addition & 0 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ import react from '@vitejs/plugin-react'
// https://vite.dev/config/
export default defineConfig({
plugins: [react()],
base: "/"
})

0 comments on commit 93fbf7f

Please sign in to comment.