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.

This commit is contained in:
Alex Williams
2024-06-21 20:01:53 +01:00
parent d3a087f8df
commit 2891130bad
2 changed files with 38 additions and 1 deletions

View File

@@ -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

38
.github/workflows/manualdeploy.yml vendored Normal file
View File

@@ -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