Skip to content

Work in progress

Work in progress #16

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: |
set -e
docker compose --file compose.yaml --file production.yaml down --remove-orphans
docker system prune --all --force
docker compose --file compose.yaml --file production.yaml up --build --force-recreate --detach
echo "Listing all Docker containers:"
docker ps -a