Skip to content

Commit

Permalink
deploy update
Browse files Browse the repository at this point in the history
  • Loading branch information
ShootGan committed Mar 14, 2024
1 parent 7816e66 commit b4689b9
Showing 1 changed file with 10 additions and 43 deletions.
53 changes: 10 additions & 43 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,49 +73,16 @@ jobs:
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
tags: ghcr.io/wkk-offcial/boi_redemption_arc:latest
tags: ghcr.io/wkk-offcial/boi_redemption_arc:latest,ghcr.io/wkk-offcial/boi_redemption_arc:${{ github.sha }}

deploy:
name: Deploy to EC2
needs: docker_build
trigger_deploy:
name: Trigger deployment pipeline
runs-on: ubuntu-latest
needs: docker_build
steps:
- name: Deploy Image on EC2
uses: appleboy/[email protected]
env:
DISCORD_TOKEN: ${{ secrets.BOI_DISCORD_TOKEN }}
SERVER_IP: ${{ secrets.SERVER_IP }}
SERVER_PORT: ${{ secrets.SERVER_PORT }}
SERVER_ENDPOINT: ${{ secrets.SERVER_ENDPOINT }}
DOCKER_BOI_IMAGE: "ghcr.io/wkk-offcial/boi_redemption_arc:latest"
DOCKER_BOI_NAME: "wkk_boi"
WAVELINK_URL: ${{ secrets.WAVELINK_URL }}
WAVELINK_PORT: ${{ secrets.WAVELINK_PORT }}
WAVELINK_PASSWORD: ${{ secrets.WAVELINK_PASSWORD }}
with:
host: ${{secrets.BOI_HOSTNAME}}
username: opc
key: ${{secrets.BOI_PRIVATE_KEY}}
envs: DISCORD_TOKEN, SERVER_IP, SERVER_ENDPOINT, SERVER_PORT, DOCKER_BOI_IMAGE, DOCKER_BOI_NAME, WAVELINK_URL, WAVELINK_PORT, WAVELINK_PASSWORD
script_stop: true
script: |
if [[ -z "$(docker network ls | grep wkk-network)" ]]; then
docker network create wkk-network
fi
docker pull $DOCKER_BOI_IMAGE
docker stop $DOCKER_BOI_NAME && docker rm -fv $DOCKER_BOI_NAME || true
docker run --restart unless-stopped \
--detach \
--network="wkk-network" \
-e BOT_TOKEN=$DISCORD_TOKEN \
-e SERVER_IP=$SERVER_IP \
-e SERVER_PORT=$SERVER_PORT \
-e SERVER_ENDPOINT=$SERVER_ENDPOINT \
-e WAVELINK_URL=$WAVELINK_URL \
-e WAVELINK_PORT=$WAVELINK_PORT \
-e WAVELINK_PASSWORD=$WAVELINK_PASSWORD \
-v /home/opc/soundboards:/wkk-bot/cache/soundboards \
--name $DOCKER_BOI_NAME \
$DOCKER_BOI_IMAGE
docker image prune <<< y
- name: Trigger deployment pipeline
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.DEPLOY_API_TOKEN }}
repository: wkk-offcial/bot_deployment
event-type: trigger-event

0 comments on commit b4689b9

Please sign in to comment.