From a93cea5589412553face5d51fa12add130509119 Mon Sep 17 00:00:00 2001 From: Akshay Date: Sat, 19 Jul 2025 21:03:05 -0400 Subject: [PATCH] Auto Publish Action --- .gitea/workflows/publish.yml | 42 ++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .gitea/workflows/publish.yml diff --git a/.gitea/workflows/publish.yml b/.gitea/workflows/publish.yml new file mode 100644 index 0000000..9b71fa5 --- /dev/null +++ b/.gitea/workflows/publish.yml @@ -0,0 +1,42 @@ +name: Publish Website +run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀 + +on: + push: + branches: [ main ] # ✅ Fixed typo from 'braches' + +jobs: + publish: + runs-on: ubuntu-latest + + steps: + - name: Checkout website repo + uses: actions/checkout@v4 # ✅ Indented correctly; moved under step + + - name: Set up SSH agent + env: + SSH_KEY: ${{ secrets.ACCESS_KEY }} + run: | + eval "$(ssh-agent -s)" + echo "$SSH_KEY" | tr -d '\r' | ssh-add - + ssh-add -l + + - name: Trust your Gitea host + run: | + mkdir -p ~/.ssh + ssh-keyscan "localhost" >> ~/.ssh/known_hosts # ✅ Fixed typo "locahost" → "localhost" + + - name: Clone template repo + run: | + git clone --depth 1 ssh://git@localhost:222/app_templates /tmp/template + + - name: Copy Docker configuration + run: | + cp /tmp/template/web/docker-compose.yml . + cp /tmp/template/web/Dockerfile . + + - name: Stop existing stack + run: docker compose down --remove-orphans || true + + - name: Rebuild and deploy + run: docker compose up -d --build