Skip to content

Commit

Permalink
Update CI-CD.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
geleeroyale authored Jan 8, 2024
1 parent 070d311 commit 376021a
Showing 1 changed file with 12 additions and 24 deletions.
36 changes: 12 additions & 24 deletions .github/workflows/CI-CD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,38 +77,26 @@ jobs:
if: github.ref == 'refs/heads/staging'
uses: garygrossgarten/[email protected]
with:
command: cd notification-center && git checkout staging && git pull && docker-compose -f docker-compose-staging.yml pull && docker-compose -f docker-compose-staging.yml down && docker-compose -f docker-compose-staging.yml up -d && docker image prune -a --force;
host: ${{ secrets.STAGING_HOST_ALL }}
username: ${{ secrets.STAGING_USERNAME_ALL }}
privateKey: ${{ secrets.STAGING_PRIVATE_KEY_ALL}}
script: |
cd giveth-all
docker compose stop notification-center
docker compose pull notification-center
docker compose up -d notification-center
docker image prune -a --force
- name: Production deploy
if: github.ref == 'refs/heads/main'
uses: garygrossgarten/[email protected]
with:
command: cd notification-center && git checkout main && git pull && docker-compose -f docker-compose-production.yml pull && docker-compose -f docker-compose-production.yml down && docker-compose -f docker-compose-production.yml up -d && docker image prune -a --force;
host: ${{ secrets.PROD_HOST_ALL }}
username: ${{ secrets.PROD_USERNAME_ALL }}
privateKey: ${{ secrets.PROD_PRIVATE_KEY_ALL}}


deploy-k8s:
if: github.ref == 'refs/heads/main'|| github.ref == 'refs/heads/staging'
needs: publish
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@master
- name: Deploy to Staging Cluster
if: github.ref == 'refs/heads/staging'
uses: steebchen/[email protected]
with: # defaults to latest kubectl binary version
config: ${{ secrets.KUBE_CONFIG }}
command: rollout restart deployments/notification-center -n backend
- name: Verify Staging Deployment
if: github.ref == 'refs/heads/staging'
uses: steebchen/[email protected]
with:
config: ${{ secrets.KUBE_CONFIG }}
version: v1.24.2 # specify kubectl binary version explicitly
command: rollout status deployments/notification-center -n backend
script: |
cd giveth-all
docker compose stop notification-center
docker compose pull notification-center
docker compose up -d notification-center
docker image prune -a --force

0 comments on commit 376021a

Please sign in to comment.