Skip to content

Commit

Permalink
quick save
Browse files Browse the repository at this point in the history
  • Loading branch information
drveles committed Jun 8, 2024
1 parent 72e3e98 commit 44b1bdc
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 16 deletions.
19 changes: 9 additions & 10 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,21 @@ jobs:
run: |
echo BOT_API_TOKEN=${{ secrets.BOT_API_TOKEN }} >> .env
echo BOT_TOKEN=${{ secrets.BOT_TOKEN }} >> .env
echo DOCKER_HUB_LOGIN=${{ secrets.DOCKER_HUB_LOGIN }} >> .env
echo DOCKER_HUB_PASSWORD=${{ secrets.DOCKER_HUB_PASSWORD }} >> .env
echo EDU_SCHOOL_LOGIN=${{ secrets.EDU_SCHOOL_LOGIN }} >> .env
echo EDU_SCHOOL_PASSWORD=${{ secrets.EDU_SCHOOL_PASSWORD }} >> .env
echo API_ADDRESS=${{ secrets.API_ADDRESS }} >> .env
echo API_PORT=${{ secrets.API_PORT }} >> .env
echo REDIS_DB=${{ secrets.REDIS_DB }} >> .env
echo REDIS_HOST=${{ secrets.REDIS_HOST }} >> .env
echo REDIS_PORT=${{ secrets.REDIS_PORT }} >> .env
echo API_ADDRESS=${{ vars.API_ADDRESS }} >> .env
echo API_PORT=${{ vars.API_PORT }} >> .env
echo REDIS_HOST=${{ vars.REDIS_HOST }} >> .env
echo REDIS_PORT=${{ vars.REDIS_PORT }} >> .env
echo REDIS_DB=${{ vars.REDIS_DB }} >> .env
- name: Deploy to server
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.DEPLOY_HOST_SERVER }}
username: ${{ secrets.DEPLOY_SERVER_USER }}
password: ${{ secrets.DEPLOY_SERVER_PASSWORD }}
host: ${{ vars.DEPLOY_HOST_SERVER }}
username: ${{ vars.DEPLOY_SERVER_USER }}
# password: ${{ secrets.DEPLOY_SERVER_PASSWORD }}
script: |
set -e
echo "Deploying application..."
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/deploy2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@ jobs:
run: |
ssh -o StrictHostKeyChecking=no ${{ vars.DEPLOY_SERVER_USER }}@${{ vars.DEPLOY_HOST_SERVER }} << 'EOF'
cd /home/${{ vars.DEPLOY_SERVER_USER }}/deploy_campus_bot
echo BOT_API_TOKEN=${{ secrets.BOT_API_TOKEN }} >> .env
echo BOT_TOKEN=${{ secrets.BOT_TOKEN }} >> .env
echo EDU_SCHOOL_LOGIN=${{ secrets.EDU_SCHOOL_LOGIN }} >> .env
echo EDU_SCHOOL_PASSWORD=${{ secrets.EDU_SCHOOL_PASSWORD }} >> .env
echo API_ADDRESS=${{ vars.API_ADDRESS }} >> .env
echo API_PORT=${{ vars.API_PORT }} >> .env
echo REDIS_HOST=${{ vars.REDIS_HOST }} >> .env
echo REDIS_PORT=${{ vars.REDIS_PORT }} >> .env
echo REDIS_DB=${{ vars.REDIS_DB }} >> .env
docker compose down
docker compose up -d --build
EOF
Expand Down
24 changes: 18 additions & 6 deletions .github/workflows/deploy3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,10 @@ on:
- all-testing

jobs:

deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

# Install ssh key
- name: Install SSH Key
uses: shimataro/ssh-key-action@v2.3.1
with:
Expand All @@ -24,5 +20,21 @@ jobs:
- name: Generate auth hosts
run: ssh-keyscan -H ${{ vars.DEPLOY_HOST_SERVER }} >> ~/.ssh/known_hosts

# Deploy
- run: rsync --archive --compress --progress . ${{ vars.DEPLOY_SERVER_USER }}@${{ vars.DEPLOY_HOST_SERVER }}:/home/${{ vars.DEPLOY_SERVER_USER }}/deploy_campus_bot
- name: Tranfer code to server
run: |
rsync --archive --compress --progress . ${{ vars.DEPLOY_SERVER_USER }}@${{ vars.DEPLOY_HOST_SERVER }}:/home/${{ vars.DEPLOY_SERVER_USER }}/deploy_campus_bot
cd /home/${{ vars.DEPLOY_SERVER_USER }}/deploy_campus_bot
echo BOT_API_TOKEN=${{ secrets.BOT_API_TOKEN }} >> .env
echo BOT_TOKEN=${{ secrets.BOT_TOKEN }} >> .env
echo EDU_SCHOOL_LOGIN=${{ secrets.EDU_SCHOOL_LOGIN }} >> .env
echo EDU_SCHOOL_PASSWORD=${{ secrets.EDU_SCHOOL_PASSWORD }} >> .env
echo API_ADDRESS=${{ vars.API_ADDRESS }} >> .env
echo API_PORT=${{ vars.API_PORT }} >> .env
echo REDIS_HOST=${{ vars.REDIS_HOST }} >> .env
echo REDIS_PORT=${{ vars.REDIS_PORT }} >> .env
echo REDIS_DB=${{ vars.REDIS_DB }} >> .env
docker compose down
docker compose up -d --build
EOF

0 comments on commit 44b1bdc

Please sign in to comment.