Skip to content

Commit

Permalink
Update main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Harsh-Srivastav123 authored May 20, 2024
1 parent 44ae19e commit 0c58021
Showing 1 changed file with 48 additions and 9 deletions.
57 changes: 48 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,26 +161,56 @@
# run: npm run build


name: React-Demo
# name: React-Demo

# on:
# push:
# branches: [main]

# # if you have src in some other folder then mention the directory.

# # defaults:
# # run:
# # working-directory: ./client

# jobs:
# build:
# runs-on: ['self-hosted', 'Linux', 'X64','demo']


# steps:
# - name: Checkout code
# uses: actions/checkout@v2

# - name: Set up Node.js
# uses: actions/setup-node@v2
# with:
# node-version: '16'
# cache: 'npm'

# - name: Install dependencies
# run: npm install

# - name: Build
# run: npm run build

name: CI/CD

on:
push:
branches: [main]

# if you have src in some other folder then mention the directory.
branches:
- main

# defaults:
# run:
# working-directory: ./client
# working-directory: ./client

jobs:
build:
runs-on: ['self-hosted', 'Linux', 'X64','demo']
runs-on: ubuntu-latest


steps:
- name: Checkout code
uses: actions/checkout@v2
- uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
Expand All @@ -193,3 +223,12 @@ jobs:

- name: Build
run: npm run build

- name: Deploy to S3
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ap-south-1
S3_BUCKET_NAME: deployment-react-123
run: |
aws s3 sync build/ s3://$S3_BUCKET_NAME --delete

0 comments on commit 0c58021

Please sign in to comment.