Skip to content

Instantly share code, notes, and snippets.

@V-Juarez
Last active August 15, 2023 05:26
Show Gist options
  • Save V-Juarez/cbf2ac4287cac9b4b371d4738ff3572e to your computer and use it in GitHub Desktop.
Save V-Juarez/cbf2ac4287cac9b4b371d4738ff3572e to your computer and use it in GitHub Desktop.
Deploy GitHub Pages

Create deploy github pages

Configurar vite.config.js

import { defineconfig } from 'vite'
import react from '@vitejs/plugin-rect'

export defaul defineConfig({
  // base: 'https://namegithub.github.io/name-project',  // add line 
  base: 'https://V-Juarez.github.io/gh-react-vite',  // add line 
  plugins: [react()]
})

Add domain github

Obtain domain

Example project | github

Automatizacion de pruebas con GitHub actions

Install

TODO: Run with reviewdog | reviewdog

Creare token

config File

name: Build and Deploy
on: [push]
permissions:
contents: write
jobs:
build-and-deploy:
concurrency: ci-${{ github.ref }} # Recommended if you intend to make multiple deployments in quick succession.
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
- name: Install and Build 🔧 # This example project is built using npm and outputs the result to the 'build' folder. Replace with the commands required to build your project, or remove this step entirely if your site is pre-built.
run: |
npm install
npm run build
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: build # The folder the action should deploy.
name: reviewdog
on: [pull_request]
jobs:
stylelint:
name: runner / stylelint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: stylelint
uses: reviewdog/action-stylelint@v1
with:
github_token: ${{ secrets.TOKEN }}
reporter: github-pr-review # Change reporter.
stylelint_input: 'src/'
name: build-test
on: [pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node: ['16']
steps:
- uses: actions/checkout@v2
- name: Setup Node 16
uses: actions/setup-node@v2
with:
node-version: 16.x
- run: npm install
- run: npm run lint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment