playrooms and games recorded to db #19
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: CI/CD with Docker Compose | |
env: | |
REPO_NAME: ${{ github.event.repository.name }} | |
on: | |
push: | |
branches: | |
- develop | |
jobs: | |
build: | |
runs-on: [self-hosted] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: executing remote ssh commands using password | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.HOST }} | |
username: ${{ secrets.USERNAME }} | |
password: ${{ secrets.PASSWORD }} | |
key: ${{ secrets.PRIVATE_KEY }} | |
script: | | |
cd ./_work/${{ env.REPO_NAME }}/${{ env.REPO_NAME }} | |
docker compose build --no-cache | |
deploy: | |
needs: [build] | |
runs-on: [self-hosted] | |
steps: | |
- name: SSH into production server and deploy | |
uses: appleboy/ssh-action@master | |
env: | |
TELEGRAM_BOT_TOKEN: ${{ secrets.DEV_TELEGRAM_BOT_TOKEN }} | |
DEVELOPER_CHAT_ID: ${{ secrets.DEVELOPER_CHAT_ID }} | |
SQLITE_DB_FILE_PATH: ${{ vars.SQLITE_DB_FILE_PATH }} | |
with: | |
host: ${{ secrets.HOST }} | |
username: ${{ secrets.USERNAME }} | |
password: ${{ secrets.PASSWORD }} | |
key: ${{ secrets.PRIVATE_KEY }} | |
script: | | |
cd ./_work/${{ env.REPO_NAME }}/${{ env.REPO_NAME }} | |
docker compose down | |
docker compose up -d \ | |
-e TELEGRAM_BOT_TOKEN=${{ secrets.DEV_TELEGRAM_BOT_TOKEN }} \ | |
-e DEVELOPER_CHAT_ID=${{ secrets.DEVELOPER_CHAT_ID }} | |
docker compose ps | |
envs: TELEGRAM_BOT_TOKEN,DEVELOPER_CHAT_ID,SQLITE_DB_FILE_PATH |