Skip to content

Commit

Permalink
[CI] - sed correction 1
Browse files Browse the repository at this point in the history
  • Loading branch information
elidakirigo committed May 13, 2024
1 parent 6fc33a8 commit 2c21241
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/statusBadge.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Build NextApp Preview and Deploy

on:
push:
branches-ignore: [main]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.19.0]
# node-version: [20.x, 21.x]

steps:
- uses: actions/checkout@v4

- name: connecting to Server
uses: appleboy/ssh-action@master
env:
FOO: 'BAR'
BAR: 'FOO'
SHA: ${{ github.sha }}
with:
host: ${{ secrets.DOGDB_HOST}}
username: ${{ secrets.DOGDB_USERNAME }}
port: ${{ secrets.DOGDB_PORT }}
key: ${{ secrets.DOGDB_PRIVATE_SSHKEY }}
source: '.'
# source: '.,!node_modules'
target: '~/var/www/'

- name: Executing remote command
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.DOGDB_HOST}}
username: ${{ secrets.DOGDB_USERNAME }}
port: ${{ secrets.DOGDB_PORT }}
key: ${{ secrets.DOGDB_PRIVATE_SSHKEY }}
script: |
cd ~ && cd /var/www/
if [ ! -d "${{secrets.DOGDB_PREVIEW_FRONTEND_FOLDER_NAME}}" -a ! -d "${{secrets.DOGDB_PREVIEW_FRONTEND_FOLDER_NAME}}-${{ github.ref_name }}" ]; then
mkdir ${{ secrets.DOGDB_PREVIEW_FRONTEND_FOLDER_NAME }} && cd ${{secrets.DOGDB_PREVIEW_FRONTEND_FOLDER_NAME}} && git clone -b ${{ github.ref_name }} https://github.com/dogdb-org/dogdb-frontend.git ${{ secrets.DOGDB_PREVIEW_FRONTEND_FOLDER_NAME }}-${{ github.ref_name }} && ${{ secrets.DOGDB_PREVIEW_FRONTEND_FOLDER_NAME }}-${{ github.ref_name }} && npm install && npm test && npm run build
elif [ -d "${{secrets.DOGDB_PREVIEW_FRONTEND_FOLDER_NAME}}" -a ! -d "${{secrets.DOGDB_PREVIEW_FRONTEND_FOLDER_NAME}}/${{secrets.DOGDB_PREVIEW_FRONTEND_FOLDER_NAME}}-${{ github.ref_name }}" ]; then
cd ${{secrets.DOGDB_PREVIEW_FRONTEND_FOLDER_NAME}} && git clone -b ${{ github.ref_name }} https://github.com/dogdb-org/dogdb-frontend.git ${{ secrets.DOGDB_PREVIEW_FRONTEND_FOLDER_NAME }}-${{ github.ref_name }} && cd ${{ secrets.DOGDB_PREVIEW_FRONTEND_FOLDER_NAME }}-${{ github.ref_name }} && npm install && npm test && npm run build
elif [ -d "${{secrets.DOGDB_PREVIEW_FRONTEND_FOLDER_NAME}}" -a -d "${{secrets.DOGDB_PREVIEW_FRONTEND_FOLDER_NAME}}/${{secrets.DOGDB_PREVIEW_FRONTEND_FOLDER_NAME}}-${{ github.ref_name }}" ]; then
cd ${{secrets.DOGDB_PREVIEW_FRONTEND_FOLDER_NAME}}/${{secrets.DOGDB_PREVIEW_FRONTEND_FOLDER_NAME}}-${{ github.ref_name }} && git pull && npm install && npm test && npm run build
fi

0 comments on commit 2c21241

Please sign in to comment.