Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed (Author was flagged for spam)

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

64
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
0%
Account Age
7 years
Verified Email
Yes
Verified Flair
No
Total Karma
42,730
Link Karma
23,665
Comment Karma
18,738
Profile updated: 1 day ago
Posts updated: 3 days 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
10 months ago