Skip to content

Commit

Permalink
ci: disable deploy on AWS
Browse files Browse the repository at this point in the history
  • Loading branch information
conganhhcmus committed Apr 24, 2024
1 parent 4d55195 commit 0dfc655
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,34 +39,34 @@ jobs:
- if: github.event_name == 'pull_request'
run: echo "${{ github.event.pull_request.title }}" | yarn commitlint

deploy-on-aws:
name: Deploy AWS
env:
PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
HOSTNAME: ${{secrets.SSH_HOST}}
USER_NAME: ${{secrets.USER_NAME}}
# deploy-on-aws:
# name: Deploy AWS
# env:
# PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
# HOSTNAME: ${{secrets.SSH_HOST}}
# USER_NAME: ${{secrets.USER_NAME}}

environment: Production
if: github.ref == 'refs/heads/master'
needs: [check]
runs-on: ubuntu-latest
steps:
- name: Deploy to AWS
run: |
echo "$PRIVATE_KEY" > private_key && chmod 600 private_key
ssh -o StrictHostKeyChecking=no -i private_key ${USER_NAME}@${HOSTNAME} '
# environment: Production
# if: github.ref == 'refs/heads/master'
# needs: [check]
# runs-on: ubuntu-latest
# steps:
# - name: Deploy to AWS
# 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/ec2-user/youth-book-api &&
git checkout master &&
git fetch --all &&
git reset --hard origin/master &&
git pull origin master &&
yarn &&
yarn build &&
pm2 stop ./dist/app.js &&
pm2 start ./dist/app.js
'
# # Now we have got the access of EC2 and we will start the deploy .
# cd /home/ec2-user/youth-book-api &&
# git checkout master &&
# git fetch --all &&
# git reset --hard origin/master &&
# git pull origin master &&
# yarn &&
# yarn build &&
# pm2 stop ./dist/app.js &&
# pm2 start ./dist/app.js
# '

build:
name: Build
Expand Down

0 comments on commit 0dfc655

Please sign in to comment.