From 6b9969651ce1e1ebdbeadbf6ae6741b1401f3758 Mon Sep 17 00:00:00 2001 From: Alex Williams Date: Fri, 21 Jun 2024 20:36:25 +0100 Subject: [PATCH] Fixed deployment steps --- .github/workflows/autodeploy.yml | 20 ++++++++------------ .github/workflows/manualdeploy.yml | 17 +++++++---------- 2 files changed, 15 insertions(+), 22 deletions(-) diff --git a/.github/workflows/autodeploy.yml b/.github/workflows/autodeploy.yml index b629b8fe..035d32ca 100644 --- a/.github/workflows/autodeploy.yml +++ b/.github/workflows/autodeploy.yml @@ -13,20 +13,18 @@ env: BRANCH_NAME: ${{ github.base_ref || github.ref_name }} # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - downloadcode: + deploy: runs-on: self-hosted steps: - - shell: bash + - name: Download the code + shell: bash run: | rm -Rf ./coriolis rm -Rf ./coriolis-data git clone https://github.com/Brighter-Applications/coriolis.git --single-branch --branch ${BRANCH_NAME} git clone https://github.com/Brighter-Applications/coriolis-data.git --single-branch --branch ${BRANCH_NAME} - - buildcode: - runs-on: self-hosted - steps: - - shell: bash + - name: Build the code + shell: bash run: | cd coriolis-data export NVM_DIR=~/.nvm @@ -34,9 +32,7 @@ jobs: npm start cd ../coriolis npm run build - movecode: - runs-on: self-hosted - steps: - - shell: bash + - name: Deploy the code + shell: bash run: | - 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 + if [ {BRANCH_NAME} == "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 diff --git a/.github/workflows/manualdeploy.yml b/.github/workflows/manualdeploy.yml index 64ee2c3b..fb7a692d 100644 --- a/.github/workflows/manualdeploy.yml +++ b/.github/workflows/manualdeploy.yml @@ -18,19 +18,18 @@ on: - live # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - downloadcode: + deploy: runs-on: self-hosted steps: - - shell: bash + - name: Download the code + 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 }} - buildcode: - runs-on: self-hosted - steps: - - shell: bash + - name: Build the code + shell: bash run: | cd coriolis-data export NVM_DIR=~/.nvm @@ -38,9 +37,7 @@ jobs: npm start cd ../coriolis npm run build - movecode: - runs-on: self-hosted - steps: - - shell: bash + - name: Deploy the code + shell: bash run: | 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