Deploying Your Client Sites
This setup uses a deployment strategy by Sharath Vignesh explained here.
Github Actions Setup
-
Create Github Secrets for Actions. In your github project for the following Workflow variables:
Each of these Github Secrets need to contain all of the variables and values found in the .env file you’ve just edited. Keep all the vairables safe somewhere on your local computer because once saved in Github Secrets you will not be able to view them again. See screenshot for reference:
-
Create seperate Github Secrets for each of the variables below. These are used in the Github Workflow templates which can be found in the .github/workflows folder:
-
Run:
-
Create three new branches after creating the main branch:
-
Push the three branches: dev, blue, and green live.
-
After a few minutes wating for the github actions (see them running under the github.com
Actions
tab) you should be able to navigate to your live website. -
running
npm start
will launch the local copy, but it uses the variables stored in the env file, so it is possible to switch between the dev, blue, and green stacks locally by commenting/uncommenting the block of variables (the live dev stack is the default)