From 568aee3e70e74c3e1deda4d7882f09bc1ee357e1 Mon Sep 17 00:00:00 2001 From: blaisadmin Date: Sat, 23 May 2026 16:32:59 -0400 Subject: [PATCH] Adding gitea action --- .gitea/workflows/deploy.yml | 45 +++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .gitea/workflows/deploy.yml diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml new file mode 100644 index 0000000..f5e26f6 --- /dev/null +++ b/.gitea/workflows/deploy.yml @@ -0,0 +1,45 @@ +name: Deploy + +on: + push: + branches: + - dev + - develop + workflow_dispatch: + +jobs: + deploy-dev: + if: ${{ github.event_name == 'push' }} + runs-on: ubuntu-latest + steps: + - name: Deploy dev over SSH + run: | + mkdir -p ~/.ssh + printf '%s\n' "${{ secrets.DEPLOY_SSH_KEY }}" > ~/.ssh/deploy_key + chmod 600 ~/.ssh/deploy_key + + ssh -i ~/.ssh/deploy_key -o StrictHostKeyChecking=accept-new "${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }}" ' + set -e + cd "${{ secrets.DEV_DEPLOY_PATH }}" + git fetch --all --prune + git pull --ff-only + docker compose up -d --build + ' + + deploy-prod: + if: ${{ github.event_name == 'workflow_dispatch' }} + runs-on: ubuntu-latest + steps: + - name: Deploy prod over SSH + run: | + mkdir -p ~/.ssh + printf '%s\n' "${{ secrets.DEPLOY_SSH_KEY }}" > ~/.ssh/deploy_key + chmod 600 ~/.ssh/deploy_key + + ssh -i ~/.ssh/deploy_key -o StrictHostKeyChecking=accept-new "${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }}" ' + set -e + cd "${{ secrets.PROD_DEPLOY_PATH }}" + git fetch --all --prune + git pull --ff-only + docker compose up -d --build + '