Skip to content

deploy fix

deploy fix #3

Workflow file for this run

name: Deploy
on:
push:
branches:
- main
jobs:
build-and-run:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install SSH Key
uses: shimataro/[email protected]
with:
key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Generate auth hosts
run: ssh-keyscan -H $SERVER_HOST >> ~/.ssh/known_hosts
- name: Sync with server
run: rsync -avz --exclude='.env' ./ $SERVER_USER@$SERVER_HOST:$SERVER_DIR
- name: Build and run
env:
SERVER_USER: $SERVER_USER
SERVER_HOST: $SERVER_HOST
SERVER_DIR: $SERVER_DIR
run: |
ssh $SERVER_USER@$SERVER_HOST << EOF
cd $SERVER_DIR
docker compose up -d --build
EOF