diff --git a/.github/workflows/build_and_deploy_frontend.yml b/.github/workflows/build_and_deploy_frontend.yml deleted file mode 100644 index 6c2836ebb3..0000000000 --- a/.github/workflows/build_and_deploy_frontend.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: Build and Deploy Tasking Manager Frontend - -on: - push: - branches: - - deployment/naxa - paths: - - "frontend/**" - workflow_dispatch: - -jobs: - deploy: - name: Deploy to Server - runs-on: [ubuntu-latest] - steps: - - name: Clone repository - uses: actions/checkout@v3 - - - name: SSH Run command - uses: appleboy/ssh-action@master - with: - host: ${{ vars.SERVER_IP }} - username: ${{ vars.SERVER_USERNAME }} - key: ${{ secrets.SSH_PRIVATE_KEY }} - command_timeout: 20m - script: | - #!/bin/bash -i - echo '==In Server==' - echo '==Building Frontend==' - export NVM_DIR=~/.nvm - source ~/.nvm/nvm.sh - cd /tmp - git clone https://github.com/naxa-developers/tasking-manager - cd tasking-manager - git checkout ${{ github.ref }} - cp /home/ubuntu/Projects/tasking-manager/tasking-manager.env . - nvm i 16 - nvm use 16 - npm i -g yarn - yarn install - npm run build - cp frontend/build/* /home/ubuntu/Projects/tasking-manager/frontend/build/ - - - # cd /home/ubuntu/Projects/tasking-manager - # git pull naxa deployment/naxa - # cd /home/ubuntu/Projects/tasking-manager/frontend - # nvm i 16 - # nvm use 16 - # npm i -g yarn - # yarn install - # npm run build diff --git a/.github/workflows/build_frontend_custom.yml b/.github/workflows/build_frontend_custom.yml new file mode 100644 index 0000000000..8d74b26e02 --- /dev/null +++ b/.github/workflows/build_frontend_custom.yml @@ -0,0 +1,37 @@ +name: TM NAXA Custom Branch CICD + +on: + push: + tags: + - force-deploy* + workflow_dispatch: + +jobs: + build-static-for-branch: + runs-on: ubuntu-latest + steps: + - name: Clone repository + uses: actions/checkout@v2 + + - name: Use Node.js 16.x + uses: actions/setup-node@v1 + with: + node-version: 16.x + + - name: Change Dir + run: cd frontend + + - name: Install dependencies + run: yarn install + + - name: Generate build + run: npm run build + + - name: copy file via ssh password + uses: appleboy/scp-action@v0.1.7 + with: + host: ${{ vars.SERVER_IP }} + username: ${{ vars.SERVER_USERNAME }} + key: ${{ secrets.SSH_PRIVATE_KEY }} + source: "./build/" + target: /home/ubuntu/Projects/tasking-manager/frontend/build/