From d1bacd18b0b56e0f7688e7582a818d0746242249 Mon Sep 17 00:00:00 2001 From: Xander Bil Date: Tue, 20 Feb 2024 21:59:21 +0100 Subject: [PATCH] Add deploy github action --- .github/workflows/master.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/master.yml diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml new file mode 100644 index 00000000..e7c791fd --- /dev/null +++ b/.github/workflows/master.yml @@ -0,0 +1,29 @@ +name: Deployment + +concurrency: + group: production + +on: + push: + branches: + - main +jobs: + deployment: + runs-on: self-hosted + environment: + name: production + url: https://sel2-5.ugent.be + steps: + - name: Add private key + shell: bash + run: | + install -m 600 -D /dev/null ~/.ssh/id_rsa + echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa + ssh-keyscan -H localhost > ~/.ssh/known_hosts + - name: deploy + run: ssh selab2@localhost "./deploy.sh" + - name: cleanup + run: rm -rf ~/.ssh + + +