Skip to content

logging stuff

logging stuff #590

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: Deploy Kohesio Dev CI
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ dev ]
pull_request:
branches: [ dev ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# 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@v2
- name: Setup SSH
run: |
mkdir -p ~/.ssh/
echo "$SSH_PRIVATE_KEY" > ../secret-key.pem
chmod 400 ../secret-key.pem
echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
shell: bash
env:
SSH_PRIVATE_KEY: ${{secrets.DEV_SSH_PEM_KEY}}
SSH_KNOWN_HOSTS: ${{secrets.DEV_KNOWN_HOSTS}}
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Build with Maven
run: mvn -P dev -B package --file pom.xml
#- name: copy using scp the packed jar
# run: scp -i ${{ github.workspace }}/../secret-key.pem target/kohesio-backend-1.0-SNAPSHOT-dev.jar ${{ secrets.DEV_USER }}@${{ secrets.DEV_HOST_IP }}:/home/ubuntu/kohesio-backend-CI-dev/
#- name: copy using scp the config file
# run: scp -i ${{ github.workspace }}/../secret-key.pem src/main/resources/config/application-server-dev.properties ${{ secrets.DEV_USER }}@${{ secrets.DEV_HOST_IP }}:/home/ubuntu/kohesio-backend-CI-dev/
#- name: kill old process
# run: ssh -i ${{ github.workspace }}/../secret-key.pem -o StrictHostKeyChecking=no ${{ secrets.DEV_USER }}@${{ secrets.DEV_HOST_IP }} 'pkill -f /home/ubuntu/kohesio-backend-CI-dev/kohesio-backend-1.0-SNAPSHOT-dev.jar' || true
#- name: run java jar
# run: ssh -i ${{ github.workspace }}/../secret-key.pem -o StrictHostKeyChecking=no ${{ secrets.DEV_USER }}@${{ secrets.DEV_HOST_IP }} "java -Dfile.encoding=UTF-8 -Dspring.config.location=file:///home/ubuntu/kohesio-backend-CI-dev/application-server-dev.properties -jar /home/ubuntu/kohesio-backend-CI-dev/kohesio-backend-1.0-SNAPSHOT-dev.jar >> /home/ubuntu/kohesio-backend-CI-dev/log 2>&1 &"
#- name: clean ssh config
# run: rm ${{ github.workspace }}/../secret-key.pem