Skip to content

Commit 6267c4f

Browse files
committed
build pipeline
1 parent 835772d commit 6267c4f

1 file changed

Lines changed: 47 additions & 47 deletions

File tree

.github/workflows/devsecops-pipeline.yml

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -309,57 +309,57 @@ jobs:
309309
run: docker stop solar-system-app && docker rm solar-system-app
310310

311311
# Stage 11: Deploy to Azure VM
312-
deploy-azure:
313-
name: Deploy to Azure VM
314-
runs-on: ubuntu-latest
315-
needs: [container-scan, dast-zap]
316-
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'
317-
permissions:
318-
contents: read
319-
packages: read
320-
environment:
321-
name: production
322-
url: http://${{ secrets.AZURE_VM_IP }}:3000
312+
# deploy-azure:
313+
# name: Deploy to Azure VM
314+
# runs-on: ubuntu-latest
315+
# needs: [container-scan, dast-zap]
316+
# if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'
317+
# permissions:
318+
# contents: read
319+
# packages: read
320+
# environment:
321+
# name: production
322+
# url: http://${{ secrets.AZURE_VM_IP }}:3000
323323

324-
steps:
325-
- name: Deploy on Azure VM
326-
uses: appleboy/ssh-action@master
327-
with:
328-
host: ${{ secrets.AZURE_VM_IP }}
329-
username: ${{ secrets.AZURE_VM_USERNAME }}
330-
key: ${{ secrets.AZURE_VM_SSH_KEY }}
331-
script: |
332-
# Log in to GitHub Container Registry
333-
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
324+
# steps:
325+
# - name: Deploy on Azure VM
326+
# uses: appleboy/ssh-action@master
327+
# with:
328+
# host: ${{ secrets.AZURE_VM_IP }}
329+
# username: ${{ secrets.AZURE_VM_USERNAME }}
330+
# key: ${{ secrets.AZURE_VM_SSH_KEY }}
331+
# script: |
332+
# # Log in to GitHub Container Registry
333+
# echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
334334

335-
# Pull the latest image
336-
docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}-${{ github.sha }}
335+
# # Pull the latest image
336+
# docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}-${{ github.sha }}
337337

338-
# Stop and remove old container if exists
339-
docker stop solar-system || true
340-
docker rm solar-system || true
338+
# # Stop and remove old container if exists
339+
# docker stop solar-system || true
340+
# docker rm solar-system || true
341341

342-
# Run new container
343-
docker run -d --name solar-system \
344-
-p 3000:3000 \
345-
--restart unless-stopped \
346-
-e MONGO_URI="${{ secrets.MONGO_URI }}" \
347-
-e MONGO_USERNAME="${{ secrets.MONGO_USERNAME }}" \
348-
-e MONGO_PASSWORD="${{ secrets.MONGO_PASSWORD }}" \
349-
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}-${{ github.sha }}
342+
# # Run new container
343+
# docker run -d --name solar-system \
344+
# -p 3000:3000 \
345+
# --restart unless-stopped \
346+
# -e MONGO_URI="${{ secrets.MONGO_URI }}" \
347+
# -e MONGO_USERNAME="${{ secrets.MONGO_USERNAME }}" \
348+
# -e MONGO_PASSWORD="${{ secrets.MONGO_PASSWORD }}" \
349+
# ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}-${{ github.sha }}
350350

351-
# Clean up old images (keep last 3)
352-
docker image prune -af --filter "until=72h"
351+
# # Clean up old images (keep last 3)
352+
# docker image prune -af --filter "until=72h"
353353

354-
# Verify deployment
355-
sleep 5
356-
curl -f http://localhost:3000/ready || exit 1
354+
# # Verify deployment
355+
# sleep 5
356+
# curl -f http://localhost:3000/ready || exit 1
357357

358-
echo "Deployment successful!"
359-
docker ps | grep solar-system
360-
361-
- name: Health check
362-
run: |
363-
sleep 10
364-
curl -f http://${{ secrets.AZURE_VM_IP }}:3000/ready || exit 1
365-
echo "Application is healthy and running!"
358+
# echo "Deployment successful!"
359+
# docker ps | grep solar-system
360+
361+
# - name: Health check
362+
# run: |
363+
# sleep 10
364+
# curl -f http://${{ secrets.AZURE_VM_IP }}:3000/ready || exit 1
365+
# echo "Application is healthy and running!"

0 commit comments

Comments
 (0)