Updated specific locations to be searchable, take a look at Las Vegas as an example.
62
I think I created my first CI/CD pipeline!
Post Body

So I have a website that uses React on the frontend and Python on the backend. This has been a great learning experience in every aspect, and the latest skills I've had to learn about is deployment and CI/CD. Here is my architecture, feel free to comment any thoughts/friendly advice/praise you have about the system!

System Design:

  • I'm using Nginx as a reverse proxy on a remote Ubuntu server. I have it configured to reroute all HTTP traffic to HTTPS.
  • I also have 2 environments configured, dev and prod, that exist as directories inside /var/www.
    • Within the Nginx config, I have all frontend requests routed to a build folder and all requests to /api/* routed to an api folder, within the correct environment.
  • I'm using pm2 to serve 2 processes - a production API service and a development API service
  • I've created 2 workflows within GitHub actions, that work as follows:
  1. On push to the dev/prod branches (branch protected, so it's functionally on completed merge request) the workflow will run.
  2. It will SSH into the machine using secrets I've stored in the repo settings
  3. For the frontend
    1. it will cd to the dir
    2. switch to the correct branch and pull
    3. install any dependencies
    4. run react build
    5. and copy the build into the correct directory, so that Nginx can serve it
  4. For the backend
    1. it will cd to the dir
    2. switch to the correct branch and pull
    3. copy the entire backend directory ./api-service/... to the correct directory
    4. activate the virtual env
    5. install any dependencies
    6. restart the pm2 service

And that's pretty much it! I don't have any users, so there isn't a big concern with scale. This is just to help me think about a situation if I did have users, and how I would develop without disrupting their experience

Author
Account Strength
100%
Account Age
7 years
Verified Email
Yes
Verified Flair
No
Total Karma
42,675
Link Karma
23,655
Comment Karma
18,693
Profile updated: 2 days ago
Posts updated: 6 months ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
8 months ago