Skip to content

Update devsecops-pipeline.yaml #1

Update devsecops-pipeline.yaml

Update devsecops-pipeline.yaml #1

name: devsecops-pipeline
on: push
jobs:
SAST:
runs-on: ubuntu-latest
steps:
# ~~~~~~~~~~~~~~~~~~~ Dumping Code ~~~~~~~~~~~~~~~~~~~
- name: Checkout the code
uses: actions/checkout@v3
# ~~~~~~~~~~~~~~~~~~~ Running SAST Scan ~~~~~~~~~~~~~~~~~~~
- name: nodejsscan scan
id: njsscan
uses: ajinabraham/njsscan-action@master
with:
args: '.'
Deploy-Server:
runs-on: ubuntu-latest
steps:
- name: Build & Deploy
env:
PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
HOSTNAME: ${{secrets.SSH_HOST}}
USER_NAME: ${{secrets.USER_NAME}}
run: |
echo "$PRIVATE_KEY" > private_key && chmod 600 private_key
ssh -o StrictHostKeyChecking=no -i private_key ${USER_NAME}@${HOSTNAME} '
# Now we have got the access of EC2 and we will start the deploy .
cd /home/ubuntu
ls
rm -rf Secure-CI-CD/
git clone https://github.com/Hack-with-8k0b/Secure-CI-CD.git
ls
cd Secure-CI-CD/
ls -la
sudo docker-compose up -d
sudo docker ps -a
sudo docker-compose up -d
'