diff --git a/.github/workflows/deploy-dev.yml b/.github/workflows/deploy-dev.yml new file mode 100644 index 0000000..740cf4a --- /dev/null +++ b/.github/workflows/deploy-dev.yml @@ -0,0 +1,28 @@ +name: Deploy to Development + +on: + push: + branches: [ "development" ] + +jobs: + build-and-deploy: + + runs-on: ubuntu-latest + + env: + SSH_KEY: ${{secrets.SSH_KEY}} + + steps: + - uses: actions/checkout@v3 + - name: Use Node.js 16 + uses: actions/setup-node@v3 + with: + node-version: 16 + cache: 'npm' + - run: mkdir ~/.ssh + - run: 'echo "$SSH_KEY" >> ~/.ssh/id_rsa_ifsalas' + - run: chmod 400 ~/.ssh/id_rsa_ifsalas + - run: echo -e "Host ifsalas\n\tUser ifsalas\n\tHostname 45.76.5.44\n\tIdentityFile ~/.ssh/id_rsa_ifsalas\n\tStrictHostKeyChecking No" >> ~/.ssh/config + - run: npm install + - run: npm run build + - run: npm run deploy:dev diff --git a/package.json b/package.json index ef39df4..63e1209 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,8 @@ "build": "react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject", - "deploy:prod": "rsync -avz --progress build/ ifsalas:/home/ifsalas/web/prod --delete" + "deploy:prod": "rsync -avz --progress build/ ifsalas:/home/ifsalas/web/prod --delete", + "deploy:dev": "rsync -avz --progress build/ ifsalas:/home/ifsalas/web/dev --delete" }, "eslintConfig": { "extends": [