From dfac22065c8f0b43c409097d8f8823792138f683 Mon Sep 17 00:00:00 2001 From: Shubham <102543960+Shubhamrahangdale@users.noreply.github.com> Date: Fri, 10 May 2024 19:46:28 +0530 Subject: [PATCH 01/11] Create main.yml --- .github/workflows/main.yml | 59 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..30b6d54b --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,59 @@ +name: CI/CD Pipeline +on: + push: + branches: + - master +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup Node.js and npm + uses: actions/setup-node@v3 + with: + node-version: '14' + npm : 'latest' + + - name: Install iltorb + run: npm install iltorb + + - name: Install build tools + run: | + sudo apt-get update + sudo apt-get install -y build-essential + + - name: Install node-gyp + run: npm install -g node-gyp + + + - name: Clear npm cache + run: npm cache clean --force + + + - name: Install dependencies + run: | + npm install || \ + npm install || \ + npm install + + - name: Cache dependencies + uses: actions/cache@v2 + with: + path: node_modules + key: ${{ runner.os }}-node_modules-${{ hashFiles('**/package-lock.json') }} + + - name: Build + run: npm run build + + - name: Deploy to AWS + uses: aws-actions/configure-aws-credentials@v2 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: us-east-1 + - run: | + aws s3 sync build/ s3://techdome-jenkins-cicd-bucket/ + aws cloudfront create-invalidation --distribution-id E1IUL1R5EKH6RA --paths "/*" From 81e9a16c29209ac470acae8f350fa2fd400735b5 Mon Sep 17 00:00:00 2001 From: Shubham <102543960+Shubhamrahangdale@users.noreply.github.com> Date: Fri, 10 May 2024 19:51:24 +0530 Subject: [PATCH 02/11] Update main.yml --- .github/workflows/main.yml | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 30b6d54b..a0aa58ca 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,33 +17,12 @@ jobs: node-version: '14' npm : 'latest' - - name: Install iltorb - run: npm install iltorb - - - name: Install build tools - run: | - sudo apt-get update - sudo apt-get install -y build-essential - - - name: Install node-gyp - run: npm install -g node-gyp - - - name: Clear npm cache run: npm cache clean --force - name: Install dependencies - run: | - npm install || \ - npm install || \ - npm install - - - name: Cache dependencies - uses: actions/cache@v2 - with: - path: node_modules - key: ${{ runner.os }}-node_modules-${{ hashFiles('**/package-lock.json') }} + run: npm install - name: Build run: npm run build From 892f391418bc4483ac9b39e9f206f1d9cef09510 Mon Sep 17 00:00:00 2001 From: Shubham <102543960+Shubhamrahangdale@users.noreply.github.com> Date: Fri, 10 May 2024 20:16:08 +0530 Subject: [PATCH 03/11] Update main.yml --- .github/workflows/main.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a0aa58ca..075b6c21 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,13 +16,20 @@ jobs: with: node-version: '14' npm : 'latest' + + - name: Use Python 2.7 + uses: actions/setup-python@v2 + with: + python-version: '2.7' - name: Clear npm cache run: npm cache clean --force - name: Install dependencies - run: npm install + run: | + npm install -g npm@latest + npm install - name: Build run: npm run build From d947f0be7b26593de553b65474c5a9612cf68bbc Mon Sep 17 00:00:00 2001 From: Shubham <102543960+Shubhamrahangdale@users.noreply.github.com> Date: Fri, 10 May 2024 20:18:32 +0530 Subject: [PATCH 04/11] Update main.yml --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 075b6c21..dbb6e0d3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,10 +17,10 @@ jobs: node-version: '14' npm : 'latest' - - name: Use Python 2.7 + - name: Use Python 3.13.0 uses: actions/setup-python@v2 with: - python-version: '2.7' + python-version: '3.13.0' - name: Clear npm cache run: npm cache clean --force From 85f55fd3e3462847aa128cdf9ec9b18777201dc7 Mon Sep 17 00:00:00 2001 From: Shubham <102543960+Shubhamrahangdale@users.noreply.github.com> Date: Fri, 10 May 2024 20:20:04 +0530 Subject: [PATCH 05/11] Update main.yml --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dbb6e0d3..82dca99f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,10 +17,10 @@ jobs: node-version: '14' npm : 'latest' - - name: Use Python 3.13.0 + - name: Use Python 3.12.0 uses: actions/setup-python@v2 with: - python-version: '3.13.0' + python-version: '3.12.0' - name: Clear npm cache run: npm cache clean --force From bd09c0042b29f334fb785eaa3f3dbceb2d5004df Mon Sep 17 00:00:00 2001 From: Shubham <102543960+Shubhamrahangdale@users.noreply.github.com> Date: Fri, 10 May 2024 20:40:34 +0530 Subject: [PATCH 06/11] Update package.json --- package.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/package.json b/package.json index 6a643870..4cc17b64 100644 --- a/package.json +++ b/package.json @@ -81,4 +81,8 @@ }, "author": "", "license": "MIT" +}, +"engines": { + "node": "18.17.0", + "npm": "9.0.0" } From b264a3fddad78fe58d1767bca6ded44dd657eda0 Mon Sep 17 00:00:00 2001 From: Shubham <102543960+Shubhamrahangdale@users.noreply.github.com> Date: Fri, 10 May 2024 23:55:00 +0530 Subject: [PATCH 07/11] Update main.yml --- .github/workflows/main.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 82dca99f..359e57d1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,6 +17,9 @@ jobs: node-version: '14' npm : 'latest' + - name: Install dependencies + run: npm install + - name: Use Python 3.12.0 uses: actions/setup-python@v2 with: From 62b8e2b2f543c010ff6dbc45b00b3f6a853be77b Mon Sep 17 00:00:00 2001 From: Shubham <102543960+Shubhamrahangdale@users.noreply.github.com> Date: Sat, 11 May 2024 07:51:22 +0530 Subject: [PATCH 08/11] Update main.yml --- .github/workflows/main.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 359e57d1..82dca99f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,9 +17,6 @@ jobs: node-version: '14' npm : 'latest' - - name: Install dependencies - run: npm install - - name: Use Python 3.12.0 uses: actions/setup-python@v2 with: From f39a1aa6d2fd5796179490a32f139c0bb0189602 Mon Sep 17 00:00:00 2001 From: Shubham <102543960+Shubhamrahangdale@users.noreply.github.com> Date: Sat, 11 May 2024 08:07:20 +0530 Subject: [PATCH 09/11] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4cc17b64..529e4a09 100644 --- a/package.json +++ b/package.json @@ -84,5 +84,5 @@ }, "engines": { "node": "18.17.0", - "npm": "9.0.0" + "npm": "latest" } From 1c6be05b066160d101ec7947458b20072ec3cf5f Mon Sep 17 00:00:00 2001 From: Shubham <102543960+Shubhamrahangdale@users.noreply.github.com> Date: Sat, 11 May 2024 08:49:30 +0530 Subject: [PATCH 10/11] Update main.yml --- .github/workflows/main.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 82dca99f..5ef8be83 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,6 +11,12 @@ jobs: - name: Checkout code uses: actions/checkout@v2 + - name: Uninstall Node.js and npm + run: | + sudo apt-get remove --purge nodejs npm + sudo apt-get autoremove + sudo apt-get autoclean + - name: Setup Node.js and npm uses: actions/setup-node@v3 with: From 73a13fe330a89344530ae31c8d9f736681a39621 Mon Sep 17 00:00:00 2001 From: Shubham <102543960+Shubhamrahangdale@users.noreply.github.com> Date: Sat, 11 May 2024 11:15:52 +0530 Subject: [PATCH 11/11] Update main.yml --- .github/workflows/main.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5ef8be83..e4b1d6ac 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -23,10 +23,10 @@ jobs: node-version: '14' npm : 'latest' - - name: Use Python 3.12.0 - uses: actions/setup-python@v2 - with: - python-version: '3.12.0' + # - name: Use Python 3.12.0 + # uses: actions/setup-python@v2 + # with: + # python-version: '3.12.0' - name: Clear npm cache run: npm cache clean --force