Skip to content

mejares-jamesmichael/GitHub-Actions-Demo

Repository files navigation

GitHub Actions Demo

This project is a simple demonstration of GitHub Actions for CI/CD (Continuous Integration/Continuous Deployment). It's a basic web page built with Vite, and it's configured to automatically deploy to GitHub Pages.

Features

  • Vite-powered: The project uses Vite for fast development and optimized builds.
  • GitHub Actions Integration: The project is set up with several GitHub Actions workflows:
    • Deploy to GitHub Pages: Automatically deploys the web page to GitHub Pages on every push to the main branch.
    • Greet New Issues: Welcomes users who open new issues with a friendly message.
    • Hello World: A simple workflow to demonstrate the basics of GitHub Actions.
  • Local Testing with act: The project is configured to be tested locally using act, a tool for running GitHub Actions locally.

Getting Started

To get a local copy up and running, follow these simple steps.

Prerequisites

  • Node.js: Make sure you have Node.js installed. You can download it from nodejs.org.
  • act (optional): If you want to run the GitHub Actions workflows locally, you'll need to install act. You can find the installation instructions in the act documentation.

Installation

  1. Clone the repo:
    git clone https://github.com/mejares-jamesmichael/GitHub-Actions-Demo.git
  2. Install NPM packages:
    npm install
    

Running the Project

To run the project locally, use the following command:

npm run dev

This will start the Vite development server, and you can view the project in your browser at http://localhost:5173/.

Usage

The main purpose of this project is to demonstrate the CI/CD pipeline with GitHub Actions. You can see the workflows in action by:

  • Pushing to main: Any push to the main branch will trigger the deployment workflow, and the changes will be reflected on the GitHub Pages site.
  • Opening an issue: If you open a new issue in the repository, the "Greet New Issues" workflow will automatically post a comment.

CI/CD

The project's CI/CD pipeline is managed by GitHub Actions. The workflows are defined in the .github/workflows directory.

  • deploy.yml: This workflow builds the Vite project and deploys it to GitHub Pages.
  • greet.yml: This workflow posts a welcome message to new issues.
  • hello.yml: This is a simple "Hello World" workflow to demonstrate the basics of GitHub Actions.

LICENSE

Distributed under the MIT License. See LICENSE for more information.

Releases

No releases published

Packages

No packages published