From f353f04428b80ddf375fe20216d2f3907a67692b Mon Sep 17 00:00:00 2001 From: petep Date: Sun, 16 Jul 2023 11:58:51 +0000 Subject: [PATCH 1/2] adding github action autodeployment --- .github/workflows/action.yml | 17 ----------------- .github/workflows/tf_update_dev.yml | 24 ++++++++++++++++++++++++ .github/workflows/tf_update_prod.yml | 24 ++++++++++++++++++++++++ .gitignore | 1 - 4 files changed, 48 insertions(+), 18 deletions(-) delete mode 100644 .github/workflows/action.yml create mode 100644 .github/workflows/tf_update_dev.yml create mode 100644 .github/workflows/tf_update_prod.yml diff --git a/.github/workflows/action.yml b/.github/workflows/action.yml deleted file mode 100644 index f0b34c1..0000000 --- a/.github/workflows/action.yml +++ /dev/null @@ -1,17 +0,0 @@ -# On every push this script is executed -on: push -name: Build and deploy GH Pages -jobs: - build: - runs-on: ubuntu-latest - if: github.ref == 'refs/heads/development' - steps: - - name: checkout - uses: actions/checkout@v2 - - name: build_and_deploy - uses: shalzz/zola-deploy-action@v0.14.1 - env: - # Target branch - PAGES_BRANCH: gh-pages - # Provide personal access token - TOKEN: ${{ secrets.TOKEN }} \ No newline at end of file diff --git a/.github/workflows/tf_update_dev.yml b/.github/workflows/tf_update_dev.yml new file mode 100644 index 0000000..b6775a9 --- /dev/null +++ b/.github/workflows/tf_update_dev.yml @@ -0,0 +1,24 @@ +name: www2.ourverse.tf +on: + push: + branches: [ development ] + +jobs: + job_one: + name: Deploy + runs-on: ubuntu-latest + steps: + - name: pushing latest change on www2.ourverse.tf + uses: appleboy/ssh-action@master + with: + host: www2.ourverse.tf + username: webuser + key: ${{ secrets.TF_SECRET }} + port: 34022 + script: | + cd websites/www2/www_ourverse/ + git log -1 + git clean -f + git pull + sed -i "s/https:\/\/ourverse.tf/https:\/\/www2.ourverse.tf/g" config.toml + ./build.sh diff --git a/.github/workflows/tf_update_prod.yml b/.github/workflows/tf_update_prod.yml new file mode 100644 index 0000000..25724ab --- /dev/null +++ b/.github/workflows/tf_update_prod.yml @@ -0,0 +1,24 @@ +name: ourverse.tf +on: + push: + branches: [ master ] + +jobs: + job_one: + name: Deploy + runs-on: ubuntu-latest + steps: + - name: pushing latest change on ourverse.tf + uses: appleboy/ssh-action@master + with: + host: ourverse.tf + username: webuser + key: ${{ secrets.TF_SECRET }} + port: 34022 + script: | + cd websites/www_ourverse/ + git log -1 + git clean -f + git pull + sed -i "s/https:\/\/www2.ourverse.tf/https:\/\/ourverse.tf/g" config.toml + ./build.sh diff --git a/.gitignore b/.gitignore index 046786f..54478de 100644 --- a/.gitignore +++ b/.gitignore @@ -26,4 +26,3 @@ install* public static/css tailwindcss -.github -- 2.40.1 From ddc7ae9bead42634b1e9efac7ce4bf53846f0bb0 Mon Sep 17 00:00:00 2001 From: petep Date: Sun, 16 Jul 2023 12:00:32 +0000 Subject: [PATCH 2/2] removing extra gh action --- .github/workflows/tf_update.yml | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 .github/workflows/tf_update.yml diff --git a/.github/workflows/tf_update.yml b/.github/workflows/tf_update.yml deleted file mode 100644 index 0d36295..0000000 --- a/.github/workflows/tf_update.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: www2.ourverse.tf -on: - push: - branch: [development] - -jobs: - job_one: - name: Deploy - runs-on: ubuntu-latest - steps: - - name: pushing latest change on www2.ourverse.tf - uses: appleboy/ssh-action@master - with: - host: www2.ourverse.tf - username: webuser - key: ${{ secrets.TF_SECRET }} - port: 34022 - script: | - cd websites/www2/www_ourverse/ - git log -1 - git restore . - git pull - bash build.sh -- 2.40.1