From 7b4e9f7ca60598c5f7f7bbd7b09488b0db31c59b Mon Sep 17 00:00:00 2001 From: Peter Nashaat Date: Mon, 29 May 2023 07:49:13 +0000 Subject: [PATCH] adding workflows autodeployment --- .github/workflows/tf_update_dev.yml | 24 +++++++++++++++++++ .../{tf_update.yml => tf_update_prod.yml} | 16 ++++++------- 2 files changed, 32 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/tf_update_dev.yml rename .github/workflows/{tf_update.yml => tf_update_prod.yml} (55%) diff --git a/.github/workflows/tf_update_dev.yml b/.github/workflows/tf_update_dev.yml new file mode 100644 index 0000000..cc8497f --- /dev/null +++ b/.github/workflows/tf_update_dev.yml @@ -0,0 +1,24 @@ +name: www2.ourworld.tf +on: + push: + branches: [ development ] + +jobs: + job_one: + name: Deploy + runs-on: ubuntu-latest + steps: + - name: pushing latest change on www2.ourworld.tf + uses: appleboy/ssh-action@master + with: + host: www2.ourworld.tf + username: webuser + key: ${{ secrets.TF_SECRET }} + port: 34022 + script: | + cd websites/www2/www_ourworld_tf/ + git log -1 + git restore . + git pull + sed -i "s/https:\/\/ourworld.tf/https:\/\/www2.ourworld.tf/g" config.toml + ./build.sh diff --git a/.github/workflows/tf_update.yml b/.github/workflows/tf_update_prod.yml similarity index 55% rename from .github/workflows/tf_update.yml rename to .github/workflows/tf_update_prod.yml index f976fdc..19ebfce 100644 --- a/.github/workflows/tf_update.yml +++ b/.github/workflows/tf_update_prod.yml @@ -1,24 +1,24 @@ -name: Ourworld.tf -on: +name: ourworld.tf +on: push: - branch: [ development ] + branches: [ master ] jobs: job_one: name: Deploy runs-on: ubuntu-latest steps: - - name: pushing latest change on www.ourworld.tf + - name: pushing latest change on ourworld.tf uses: appleboy/ssh-action@master with: - host: www.ourworld.tf + host: ourworld.tf username: webuser key: ${{ secrets.TF_SECRET }} port: 34022 script: | cd websites/www_ourworld_tf/ git log -1 + git restore . git pull - bash build.sh - - + sed -i "s/https:\/\/www2.ourworld.tf/https:\/\/ourworld.tf/g" config.toml + ./build.sh