Skip to content
name: Continious Deployment To Lightsail Server in Harmfurt
on:
push:
branches: [ master ]
jobs:
copy_content_to_server:
runs-on: ubuntu-latest
steps:
- name: install rsync
run: sudo apt-get install rsync
- name: checkout
uses: actions/checkout@v2
- name: build
run: |
npm ci
npm run build
ls -la
pwd
- name: build & ssh-deploy
uses: easingthemes/ssh-deploy@main
env:
SSH_PRIVATE_KEY: ${{ secrets.ACTION_LIGHTSAIL_SECRET }}
ARGS: "-rltgoDzvO --delete"
SOURCE: "docs"
REMOTE_HOST: ${{ secrets.SSH_HOST }}
REMOTE_USER: ${{ secrets.SSH_USER }}
TARGET: ${{ secrets.FOLDER_OF_APP }}
sync-nginx-config:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
- name: build & ssh-deploy
uses: easingthemes/ssh-deploy@main
env:
SSH_PRIVATE_KEY: ${{ secrets.ACTION_LIGHTSAIL_SECRET }}
ARGS: "-rltgoDzvO --delete"
SOURCE: "nginx.conf"
REMOTE_HOST: ${{ secrets.SSH_HOST }}
REMOTE_USER: ${{ secrets.SSH_USER }}
TARGET: ${{ secrets.FOLDER_OF_APP }}
launch-nginx-static-serving:
runs-on: ubuntu-latest
steps:
- name: executing remote ssh commands using password
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
port: ${{ secrets.SSH_PORT }}
key: ${{ secrets.ACTION_LIGHTSAIL_SECRET }}
script_stop: true
script: |
sudo nginx -t -c ~/CV/nginx.conf
echo 'Hello world of Lightsail'