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