Skip to content

Merge pull request #852 from parys/renovate/docker-build-push-action-… #741

Merge pull request #852 from parys/renovate/docker-build-push-action-…

Merge pull request #852 from parys/renovate/docker-build-push-action-… #741

# This is a basic workflow to help you get started with Actions
name: CI-deploy-to-test-on-each-push-1
# Controls when the action will run. Triggers the workflow on push or pull request
## events but only for the master branch
on:
push:
branches: [ develop ]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: '16.x'
- name: Install npm dependencies
run: npm install
- name: Run build task
run: npm run build:test --if-present
- name: Deploy to Server
uses: easingthemes/ssh-deploy@v3.4.5
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_DEPLOY_KEY }}
ARGS: "-avzr --delete --exclude=/browser/src/"
SOURCE: "dist/test/"
REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
REMOTE_USER: ${{ secrets.SSH_DEPLOY_USER }}
REMOTE_PORT: ${{ secrets.REMOTE_PORT }}
TARGET: ${{ secrets.SERVER_TEST_FOLDER }}
- name: restart prod service
uses: fifsky/ssh-action@master
with:
command: |
pm2 restart test
host: ${{ secrets.REMOTE_HOST }}
port: ${{ secrets.REMOTE_PORT }}
user: ${{ secrets.SSH_DEPLOY_USER }}
key: ${{ secrets.SSH_DEPLOY_KEY }}