Skip to content

Work in progress

Work in progress #9

Workflow file for this run

name: Deploy
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up SSH Key
run: |
mkdir -p ~/.ssh
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
- name: Configure SSH known_hosts
run: |
ssh-keyscan -H ${{ secrets.HETZNER_IP }} >> ~/.ssh/known_hosts
- name: Deploy using Docker Compose
env:
DOCKER_HOST: ssh://root@${{ secrets.HETZNER_IP }}
CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }}
run: |
if docker ps -a --format '{{.Names}}' | grep -Eq '^redis$'; then
echo "Removing existing 'redis' container..."
docker rm -f redis
else
echo "'redis' container does not exist. No action needed."
fi
docker system prune --all --force
docker compose --file compose.yaml --file cloudflare.yaml --file logging.yaml up --build --force-recreate --detach