From 115ad4845725aeb63d461c10e64fff33b0b1938a Mon Sep 17 00:00:00 2001 From: Gabriel Carneiro Date: Mon, 5 Aug 2024 17:02:36 -0300 Subject: [PATCH] update workflows --- .../{deploy.yml => build_and_deploy.yml} | 2 +- .gitea/workflows/ssh_build.yml | 28 +++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) rename .gitea/workflows/{deploy.yml => build_and_deploy.yml} (98%) create mode 100755 .gitea/workflows/ssh_build.yml diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/build_and_deploy.yml similarity index 98% rename from .gitea/workflows/deploy.yml rename to .gitea/workflows/build_and_deploy.yml index 86728e7..9020dc1 100755 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/build_and_deploy.yml @@ -1,6 +1,6 @@ name: Gitea Actions Demo run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀 -on: [push] +on: [workflow_dispatch] jobs: Deploy: diff --git a/.gitea/workflows/ssh_build.yml b/.gitea/workflows/ssh_build.yml new file mode 100755 index 0000000..1dbdcbe --- /dev/null +++ b/.gitea/workflows/ssh_build.yml @@ -0,0 +1,28 @@ +name: SSH Build +run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀 +on: [push,workflow_dispatch] + +jobs: + Deploy: + runs-on: ubuntu-latest + steps: + - run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event." + - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!" + - run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}." + - name: Check out repository code + uses: RouxAntoine/checkout@v3.5.4 + - run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner." + - run: echo "🖥️ The workflow is now ready to test your code on the runner." + + - name: Deploy to Server + run: | + echo "${{ secrets.SCP_KEY_ALICE }}" > /tmp/ssh_private_key + chmod 600 /tmp/ssh_private_key + ssh -o "StrictHostKeyChecking no" -i /tmp/ssh_private_key act_runner@alice.ufsj.edu.br -p ${{ secrets.SSH_PORT_ALICE }} << 'EOF' + cd /var/www/src/AliceClass + git pull origin main + bundle install + make deploy + EOF + + - run: echo "🍏 This job's status is ${{ job.status }}."