From d17d839007a2963159a84ebc9c2273d83ccfdca9 Mon Sep 17 00:00:00 2001 From: Peter Nashaat Date: Tue, 25 Oct 2022 10:33:37 +0000 Subject: [PATCH] adding autodeployment --- .github/workflows/tf_update.yml | 23 +++++++++++++++++++++++ .gitignore | 5 +++++ 2 files changed, 28 insertions(+) create mode 100644 .github/workflows/tf_update.yml create mode 100644 .gitignore diff --git a/.github/workflows/tf_update.yml b/.github/workflows/tf_update.yml new file mode 100644 index 0000000..9457a54 --- /dev/null +++ b/.github/workflows/tf_update.yml @@ -0,0 +1,23 @@ +name: event2.ourworld.tf +on: + push: + branch: [ development ] + +jobs: + job_one: + name: Deploy + runs-on: ubuntu-latest + steps: + - name: pushing latest change on event2.ourworld.tf + uses: appleboy/ssh-action@master + with: + host: event2.ourworld.tf + username: webuser + key: ${{ secrets.TF_SECRET }} + port: 34022 + script: | + cd /home/webuser/websites/www2/www_ourworld_ictc + git log -1 + git pull + name=$(basename "$PWD") + if [ -z $(tmux list-sessions | grep $name | awk '{ print $1 }') ]; then echo tmux new-session -d -s $name 'bash run.sh' ; else tmux kill-session -t $name ; tmux new-session -d -s $name 'bash run.sh' ; fi diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..24266c2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +templates/tickets.html +static/css/index.css +www_ourworld_ictc +ticket +tailwindcss