Skip to content

Commit

Permalink
Updated workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
ezhil56x committed Jan 20, 2024
1 parent 6d3befd commit db9d545
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,24 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
- name: Checkout repo 🛎️
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Calculate short hash
run: |
shortHash=$(git rev-parse --short ${{ github.sha }})
echo "COMMIT_SHORT_SHA=$shortHash" >> $GITHUB_ENV
- name: SSH setup and run commands
- name: Deploy 🚀
uses: appleboy/[email protected]
with:
host: ${{ secrets.SSH_HOST }}
key: ${{ secrets.SSH_KEY }}
username: ${{ secrets.SSH_USER }}
passphrase: ${{ secrets.SSH_PASSPHRASE }}
script: |
cd ./deploy/${{ github.event.repository.name }}
cd ./deploy-main/${{ github.event.repository.name }}
git pull
docker rm --force ${{ github.event.repository.name }}-deploy 2> /dev/null
docker build -t ${{ github.repository }}:${{ env.COMMIT_SHORT_SHA }} --quiet .
docker run --detach --name ${{ github.event.repository.name }}-deploy ${{ github.repository }}:${{ env.COMMIT_SHORT_SHA }}
docker container prune --force && docker image prune --all --force
docker container rm -f cyscom-bot || true
docker image rm -f cyscom-bot || true
docker build -t cyscom-bot --quiet .
docker run -d \
--name cyscom-bot \
--restart always \
--env-file .env.bot

0 comments on commit db9d545

Please sign in to comment.