This repository has been archived by the owner on Sep 16, 2024. It is now read-only.
Deploy to production server #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy to production server | |
concurrency: | |
group: production | |
cancel-in-progress: false | |
on: | |
workflow_dispatch: | |
jobs: | |
deploy: | |
name: Deploy to production server | |
runs-on: self-hosted | |
environment: | |
name: production | |
url: https://t.me/InnoMusicRoomBot | |
steps: | |
- name: Deploy via SSH | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.SSH_HOST }} | |
username: ${{ secrets.SSH_USERNAME }} | |
key: ${{ secrets.SSH_KEY }} | |
fingerprint: ${{ secrets.SSH_FINGERPRINT }} | |
script_stop: true # Stop script on error | |
script: | | |
cd ${{ secrets.REPOSITORY_ROOT }} | |
git reset --hard | |
git checkout ${{ github.ref_name }} | |
git pull | |
docker compose build --pull | |
docker compose pull | |
docker compose up -d |