Giter Club home page Giter Club logo

react-deployment-template's Introduction

React project template

โš  README CURRENTLY OUT OF DATE

This template bootstraps a React project with CI/CD workflows through GitHub Actions.

Benefits:

  • Keep a clean and organized development process.
  • Automatate testing and deployment of code to staging and production environments.
  • Automatically upload artifacts and coverage reports.

๐Ÿ’ป To use ๐Ÿ’ป

1. Select 'Use this template'

Creating a repo from a template

2. Set branch structure

Your branch used for production/deployment is the default branch, master. For CI/CD to work correctly, you must create a branch off of master, develop. This will be your staging branch.

All features and updates should be made through a unique branch, and PR's made to develop.

The above process is necessary for the workflow to work as intented. Beyond develop and master, you can use any branch name you like.

3. Set up Surge

  • Install surge (npm install -g surge)
  • Run surge to create a domain. You will want to do this twice and set two different domains - one for staging and one for production. Must have a Surge account.

Reference video.

4. Link repository to Codecov

For code coverage reporting, you must register your repository with Codecov. Instructions found here.

5. Customize workflow

The workflow for this project can be found at .github/workflows.

Properties to update:

  • STAGING_URL (line 14)
  • PRODUCTION_URL (line 15)

Update lines 14-15 with the staging and production URLs you set in step 3.


This workflow will run on a PR or push to the develop or master branch. Below is an overview of how the workflow operates with each event:

For more information on GitHub Actions, see the docs.


6. Set GitHub Secrets

In your GitHub repository, navigate to Settings โžก Secrets โžก Actions. Create two secrets with the following keys and values:

  • SURGE_LOGIN - your Surge ID
  • SURGE_TOKEN - your Surge password

You are now ready to begin adding your own code and deploying!

react-deployment-template's People

Contributors

cwayr avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.