Git Product home page Git Product logo

javascripthubpet1's Introduction

Project still in development

Javascript CI/CD Project

This repository contains a simple CI/CD project that automates the process of building a Docker image on self-hosted GitHub Runner, pushing it to Docker Hub, creating infrastructure on AWS, installing and deploying the Docker image to an EC2 instance.

Tech Stack

  • JavaScript
  • Docker
  • Terraform
  • Ansible
  • GitHub Actions
  • AWS

Prerequirements/Instalation

  1. AWS Account:
    • Create a new user
    • Create key pair
  2. DockerHub Account:
    • Create a new repository
  3. Create Terraform Cloud Account:
    • Create a new organization
    • Create a new project in organization
    • Create a new workspace in project
    • Change backend block in root's providers.tf to your configuration:
       backend "remote"  {
       organization = "YourOrgName"
    
       workspaces {
          name = "YourWorkspaceName"
       }  
    }
    
  4. Set up GitHub Runner in your project
  5. Prepare VM for self-hosted GitHub Runner:
    • Install self-hosted GitHub Runner, terrafom, ansible and docker
    • Save AWS SSH private key file generated in 1st step in your user's .ssh folder
  6. Setup GitHub project secrets:
    • AWS_ACCESS_KEY_ID - your AWS_ACCESS_KEY_ID
    • AWS_SECRET_ACCESS_KEY - your AWS_SECRET_ACCESS_KEY
    • DOCKER_PASSWORD - your DockerHub account password
    • DOCKER_USERNAME - your DockerHub account name
    • SSH_KEY - content of AWS SSH private key generated in 1st step for Ansible to connect to EC2. e.g., raw content
    • SSH_USERNAME - ssh username
    • TFVARS_FILE - edit terraform.tfvars.template and copy all content into this secret

Usage

  1. Clone/fork this project

javascripthubpet1's People

Contributors

vnavalianyi 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.