GithubHelp home page GithubHelp logo

aws-ecs-ci-cd's Introduction

AWS ECS CI/CD

Overview

This repository contains the code for the AWS ECS CI/CD pipeline. The pipeline is responsible for building and deploying the application to the ECS cluster.

Project Structure

  • .github/workflows: Contains the GitHub Actions workflow files.
  • server: Contains the backend Node.js application.
  • client: Contains the frontend code.

CI/CD Pipeline

The CI/CD pipeline is triggered on pushes to the following branches:

  • main
  • Any branch containing the word backend
  • Any branch containing the word frontend

Backend Pipeline (build-and-push-backend job)

The backend pipeline consists of the following steps:

  1. Checkout code: Fetch the latest code.
  2. Setup Node.js: Set up Node.js environment (Node.js version 14).
  3. Install dependencies: Install project dependencies using npm.
  4. Configure AWS credentials: Set up AWS credentials for deployment.
  5. Login to Amazon ECR: Authenticate with Amazon Elastic Container Registry (ECR).
  6. Build, tag, and push image to Amazon ECR: Build Docker image for the backend, tag it, and push it to ECR.
  7. Fill in the new image ID in the Amazon ECS task definition: Update the ECS task definition with the new Docker image.
  8. Deploy to Amazon ECS: Deploy the updated task definition to ECS.

Frontend Pipeline (build-and-push-frontend job)

The frontend pipeline is not implemented in this repository. Contributors are encouraged to follow a similar process as the backend pipeline for testing and deploying the frontend component.

Usage

To contribute to this project or test the CI/CD pipeline, follow these steps:

  1. Clone the repository:
     git clone [email protected]:MEZ901/aws-ecs-ci-cd.git
  2. Make changes or create a new feature branch:
     git checkout -b feature-<feature-name>-backend
  3. Commit and push your changes:
     git add .
     git commit -m "Add new feature"
     git push origin feature-<feature-name>-backend
     ```
  4. The CI/CD pipeline will be triggered based on your branch name, and the changes will be deployed to AWS ECS.

Secrets

Make sure to set the following secrets in your GitHub repository:

  • AWS_ACCESS_KEY_ID: Your AWS access key ID.
  • AWS_SECRET_ACCESS_KEY: Your AWS secret access key.

Notes

  • The backend is deployed to the js-service service in the lacasadeljs cluster.
  • The ECS task definition is defined in task-definition-js.json.

aws-ecs-ci-cd's People

Contributors

mez901 avatar

Watchers

 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.