From 2891130bad53ef645f0089ae43d6d687941a4c27 Mon Sep 17 00:00:00 2001 From: Alex Williams Date: Fri, 21 Jun 2024 20:01:53 +0100 Subject: [PATCH] Setting up definitive workflows, automatic for when coriolis is being updated, either on its own, or along with coriolis-data and manual, for when we've updated coriolis-data and need to re-deploy. --- .github/workflows/autodeploy.yml | 1 - .github/workflows/manualdeploy.yml | 38 ++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/manualdeploy.yml diff --git a/.github/workflows/autodeploy.yml b/.github/workflows/autodeploy.yml index 4fa7008a..4722b4f9 100644 --- a/.github/workflows/autodeploy.yml +++ b/.github/workflows/autodeploy.yml @@ -4,7 +4,6 @@ name: Auto-Deploy 'beta/live' Branch to beta.coliolis.io or coriolis.io # Controls when the action will run. Workflow runs when the alpha branch receives a push event on: - workflow_dispatch: push: branches: - beta diff --git a/.github/workflows/manualdeploy.yml b/.github/workflows/manualdeploy.yml new file mode 100644 index 00000000..3af8ff34 --- /dev/null +++ b/.github/workflows/manualdeploy.yml @@ -0,0 +1,38 @@ +# This is a basic manual deployment workflow triggered by pushes to the beta and live branches. + +name: Manual-Deploy 'beta/live' Branch to beta.coliolis.io or coriolis.io + +# Controls when the action will run. Workflow runs when the alpha branch receives a push event +on: + workflow_dispatch: + # Get the target branch name + inputs: + branch: + type: choice + description: 'Branch Name' + required: true + default: 'beta' + # Only allow beta or live branches + options: + - beta + - live +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + downloadcode: + runs-on: self-hosted + steps: + - shell: bash + run: | + rm -Rf ./coriolis + rm -Rf ./coriolis-data + git clone https://github.com/Brighter-Applications/coriolis.git --single-branch --branch ${{ github.events.inputs.branch }} + git clone https://github.com/Brighter-Applications/coriolis-data.git --single-branch --branch ${{ github.events.inputs.branch }} + cd coriolis-data + export NVM_DIR=~/.nvm + source ~/.nvm/nvm.sh + npm install + npm start + cd ../coriolis + npm install + npm run build + if [ ${{ github.events.inputs.branch }} == "beta" ]; then sudo -u www-data cp -r ./build/* /var/www/beta.coriolis.io/; else sudo -u www-data cp -r ./build/* /var/www/coriolis.io/; fi