Update main.yml #42
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# name: Quizmate-Frontend | |
# on: | |
# push: | |
# branches: [main] | |
# defaults: | |
# run: | |
# working-directory: ./client | |
# jobs: | |
# build: | |
# runs-on: ['self-hosted', 'Linux', 'X64', 'react'] | |
# 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: Quizmate-Frontend | |
# on: | |
# push: | |
# branches: [main] | |
# defaults: | |
# run: | |
# working-directory: ./client | |
# jobs: | |
# build: | |
# runs-on: ubuntu-latest | |
# 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: Archive dist folder | |
# # uses: actions/upload-artifact@v2 | |
# # with: | |
# # name: dist | |
# # path: dist | |
# # - name: Copy dist folder to client directory | |
# # run: cp -r dist/ ../client/ | |
# - name: Commit and push changes | |
# run: | | |
# git config --global user.email "[email protected]" | |
# git config --global user.name "Harsh-Srivastav123" | |
# git add . | |
# git commit -m "Update dist folder" | |
# git push origin main | |
# Deploy: | |
# runs-on: ['self-hosted', 'Linux', 'X64', 'gcp'] | |
# steps: | |
# - name: Checkout code and dist folder | |
# uses: actions/checkout@v2 | |
# - name: Restart Nginx | |
# run: sudo systemctl restart nginx | |
# name: CI/CD | |
# on: | |
# push: | |
# branches: | |
# - main | |
# # defaults: | |
# # run: | |
# # working-directory: ./client | |
# jobs: | |
# build: | |
# runs-on: ubuntu-latest | |
# steps: | |
# - 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: 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 | |
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','nginx'] | |
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 |