Skip to content

[WIP] Configure GitHub Pages for automatic deployment#1

Merged
nicodevvv merged 1 commit into
mainfrom
copilot/configure-github-pages
Dec 7, 2025
Merged

[WIP] Configure GitHub Pages for automatic deployment#1
nicodevvv merged 1 commit into
mainfrom
copilot/configure-github-pages

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Dec 7, 2025

Thanks for asking me to work on this. I will get started on it and keep this PR's description up to date as I form a plan and make progress.

Original prompt

Configurar GitHub Pages para el proyecto

Necesito configurar GitHub Pages para desplegar automáticamente este proyecto de React + Vite.

Tareas a realizar:

1. Actualizar vite.config.ts

Agregar la configuración base para que funcione correctamente en GitHub Pages:

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react-swc'

// https://vite.dev/config/
export default defineConfig({
  plugins: [react()],
  base: '/javascript-quizz-zustand/'
})

2. Crear GitHub Actions Workflow

Crear el archivo .github/workflows/deploy.yml con el siguiente contenido:

name: Deploy to GitHub Pages

on:
  push:
    branches: [ main ]
  workflow_dispatch:

permissions:
  contents: read
  pages: write
  id-token: write

concurrency:
  group: "pages"
  cancel-in-progress: false

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4
        
      - name: Setup Node
        uses: actions/setup-node@v4
        with:
          node-version: 20
          cache: 'npm'
          
      - name: Install dependencies
        run: npm ci
        
      - name: Build
        run: npm run build
        
      - name: Setup Pages
        uses: actions/configure-pages@v4
        
      - name: Upload artifact
        uses: actions/upload-pages-artifact@v3
        with:
          path: './dist'
          
  deploy:
    environment:
      name: github-pages
      url: ${{ steps.deployment.outputs.page_url }}
    runs-on: ubuntu-latest
    needs: build
    steps:
      - name: Deploy to GitHub Pages
        id: deployment
        uses: actions/deploy-pages@v4

3. Actualizar package.json

Agregar el script de preview para GitHub Pages (opcional pero útil):

{
  "scripts": {
    "dev": "vite",
    "build": "tsc -b && vite build",
    "lint": "eslint .",
    "preview": "vite preview"
  }
}

Notas importantes:

  • El workflow se ejecutará automáticamente en cada push a la rama main
  • Después de hacer merge de este PR, se debe habilitar GitHub Pages en la configuración del repositorio (Settings → Pages → Source: GitHub Actions)
  • La aplicación estará disponible en: https://nicodevvv.github.io/javascript-quizz-zustand/

This pull request was created as a result of the following prompt from Copilot chat.

Configurar GitHub Pages para el proyecto

Necesito configurar GitHub Pages para desplegar automáticamente este proyecto de React + Vite.

Tareas a realizar:

1. Actualizar vite.config.ts

Agregar la configuración base para que funcione correctamente en GitHub Pages:

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react-swc'

// https://vite.dev/config/
export default defineConfig({
  plugins: [react()],
  base: '/javascript-quizz-zustand/'
})

2. Crear GitHub Actions Workflow

Crear el archivo .github/workflows/deploy.yml con el siguiente contenido:

name: Deploy to GitHub Pages

on:
  push:
    branches: [ main ]
  workflow_dispatch:

permissions:
  contents: read
  pages: write
  id-token: write

concurrency:
  group: "pages"
  cancel-in-progress: false

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4
        
      - name: Setup Node
        uses: actions/setup-node@v4
        with:
          node-version: 20
          cache: 'npm'
          
      - name: Install dependencies
        run: npm ci
        
      - name: Build
        run: npm run build
        
      - name: Setup Pages
        uses: actions/configure-pages@v4
        
      - name: Upload artifact
        uses: actions/upload-pages-artifact@v3
        with:
          path: './dist'
          
  deploy:
    environment:
      name: github-pages
      url: ${{ steps.deployment.outputs.page_url }}
    runs-on: ubuntu-latest
    needs: build
    steps:
      - name: Deploy to GitHub Pages
        id: deployment
        uses: actions/deploy-pages@v4

3. Actualizar package.json

Agregar el script de preview para GitHub Pages (opcional pero útil):

{
  "scripts": {
    "dev": "vite",
    "build": "tsc -b && vite build",
    "lint": "eslint .",
    "preview": "vite preview"
  }
}

Notas importantes:

  • El workflow se ejecutará automáticamente en cada push a la rama main
  • Después de hacer merge de este PR, se debe habilitar GitHub Pages en la configuración del repositorio (Settings → Pages → Source: GitHub Actions)
  • La aplicación estará disponible en: https://nicodevvv.github.io/javascript-quizz-zustand/

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@nicodevvv nicodevvv marked this pull request as ready for review December 7, 2025 10:45
@nicodevvv nicodevvv merged commit 74b1645 into main Dec 7, 2025
1 check failed
Copilot AI requested a review from nicodevvv December 7, 2025 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants