diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml index 28b05d7..e38268e 100644 --- a/.gitea/workflows/test.yml +++ b/.gitea/workflows/test.yml @@ -1,14 +1,38 @@ -name: test +name: Deploy to App Container on: - push: - branches: - - main + push: + branches: + - main jobs: - hello: - runs-on: ubuntu-22.04 + build-and-deploy: + runs-on: ubuntu-22.04 + steps: + - name: Deploy via SSH + run: | + ssh -o StrictHostKeyChecking=no -i /opt/gitea-runner/id_ed25519 ci@192.168.1.243 << 'EOF' + APP_DIR=/home/ci/app - steps: - - name: Say hello - run: echo "hiiiiillo" + # Remove old repo + if [ -d "$APP_DIR" ]; then + echo "Deleting existing repo..." + rm -rf "$APP_DIR" + fi + + # Clone latest code + echo "Cloning latest code..." + git clone git@192.168.1.133:3000/gibby/go-htmx-local.git "$APP_DIR" + cd "$APP_DIR" + + # Optional: pull submodules if you use them + # git submodule update --init --recursive + + # Stop any running containers + echo "Stopping old container..." + make docker-down || true + + # Build & start new container + echo "Starting new container..." + make docker-run + EOF