Skip to content

Commit

Permalink
Merge pull request #54 from tekdi/oblf-21stFeb
Browse files Browse the repository at this point in the history
Merging new changes from oblf
  • Loading branch information
vaivk369 authored Feb 26, 2024
2 parents 84d8dfa + 4f8070e commit 7816eb4
Show file tree
Hide file tree
Showing 19 changed files with 1,556 additions and 1,116 deletions.
79 changes: 79 additions & 0 deletions .github/workflows/oblf-21stFeb-9.20.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Deploy to oblf-21stFeb
on:
push:
branches:
- oblf-21stFeb
jobs:
build:
name: Generate Build and Deploy to DEV
# environment: PROD
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Node Env
uses: actions/setup-node@v3
with:
node-version: 21.1.0

- name: Generate React Build
run: |
yarn install
yarn build
- name: Create Lerna Bundles for Submodules
run: |
sh ./scripts/pack-prod-build.sh
- name: Show PWD
run: |
echo "Current Working Directory:"
pwd
- name: List Contents
run: |
echo "Contents of the current directory (in reverse order):"
ls -lr
# - name: List Contents
# run: |
# echo "Contents of the dist directory (in reverse order):"
# cd /home/runner/work/shiksha-frontend/shiksha-frontend/dist
# ls -lr

- name: Deploy to Server 1
uses: easingthemes/ssh-deploy@main
env:
SSH_PRIVATE_KEY: ${{ secrets.EC2_SSH_KEY }}
REMOTE_HOST: ${{ secrets.HOST_DNS }}
REMOTE_USER: ${{ secrets.USERNAME }}
TARGET: ${{ secrets.TARGET_DIR }}

- name: Set up SSH key
run: |
mkdir -p ~/.ssh
echo "${{ secrets.EC2_SSH_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
# Add the SSH key to the known_hosts file (replace hostname with your actual hostname)
ssh-keyscan -H ${{ secrets.HOST_DNS }} >> ~/.ssh/known_hosts
# - name: Deploy with rsync
# run: |
# rsync -avz -e "ssh -i ~/.ssh/id_rsa" ./dist/ ${{ secrets.USERNAME }}@${{ secrets.HOST_DNS }}:/home/ubuntu/prasad


- name: Copy Build Artifact using Rsync
run: rsync -avz -e "ssh -p ${{ secrets.PORT }}" shiksha-ui.tar ${{ secrets.USERNAME }}@${{ secrets.HOST_DNS }}:/home/prasad

- name: Unzip Artifact to Correct Locations to Deploy
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST_DNS }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.EC2_SSH_KEY }}
script: |
cd /home/prasad
tar -xvf shiksha-ui.tar -C /var/www/shiksha.uniteframework.io/new
8 changes: 8 additions & 0 deletions .well-known/assetlinks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[{
"relation": ["delegate_permission/common.handle_all_urls"],
"target": {
"namespace": "android_app",
"package_name": "io.uniteframework.shiksha.twa",
"sha256_cert_fingerprints": ["5D:27:14:88:B0:06:02:E1:20:BB:4E:41:88:76:FD:32:0F:A4:26:EC:FE:BD:DA:C1:70:88:89:8C:50:C8:E9:F3"]
}
}]
1 change: 1 addition & 0 deletions 1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

33 changes: 33 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
pipeline {
agent any
stages {
stage('clean workspace'){
steps{
cleanWs()
}
}
stage('Checkout'){

steps{

// git branch: 'main', credentialsId: 'github-1', url: 'https://github.com/tekdi/shiksha-backend.git'
// checkout scmGit(branches: [[name: '*/oblf-21stFeb']], extensions: [], userRemoteConfigs: [[credentialsId: 'github-1', url: 'https://github.com/tekdi/shiksha-backend.git']])
checkout scmGit(branches: [[name: '*/oblf-21stFeb']], extensions: [], userRemoteConfigs: [[credentialsId: 'github-1', url: 'https://github.com/tekdi/shiksha-frontend.git']])

echo "========================== ***Repository cloned Successfully*** =========================="

}
}

stage ('Build&Deploy') {

steps {

sh 'yarn install'
sh 'yarn run build'
sh './scripts/pack-prod-build.sh'
}
}

}
}
Loading

0 comments on commit 7816eb4

Please sign in to comment.