split copy + start in 2 jobs
This commit is contained in:
parent
01f407440c
commit
b72228ce36
1 changed files with 29 additions and 2 deletions
|
@ -36,7 +36,7 @@ jobs:
|
||||||
name: static-site
|
name: static-site
|
||||||
path: public/
|
path: public/
|
||||||
|
|
||||||
deploy-site:
|
deploy-files:
|
||||||
needs: [ build-site ]
|
needs: [ build-site ]
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
env:
|
env:
|
||||||
|
@ -70,6 +70,34 @@ jobs:
|
||||||
rm -r -f fgo-ta_com/public/*
|
rm -r -f fgo-ta_com/public/*
|
||||||
- name: Copy files using rsync
|
- name: Copy files using rsync
|
||||||
run: rsync -az --stats public/* ${{ env.DEPLOY_USER }}@${{ env.DEPLOY_HOST }}:~/fgo-ta_com/public
|
run: rsync -az --stats public/* ${{ env.DEPLOY_USER }}@${{ env.DEPLOY_HOST }}:~/fgo-ta_com/public
|
||||||
|
- name: Check files on deploy target
|
||||||
|
uses: https://github.com/appleboy/ssh-action@master
|
||||||
|
with:
|
||||||
|
host: ${{ env.DEPLOY_HOST }}
|
||||||
|
username: ${{ env.DEPLOY_USER }}
|
||||||
|
key: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||||
|
script: |
|
||||||
|
cd fgo-ta_com
|
||||||
|
find public -maxdepth 1 -printf "%p\n"
|
||||||
|
|
||||||
|
deploy-site:
|
||||||
|
needs: [ deploy-files ]
|
||||||
|
runs-on: docker
|
||||||
|
env:
|
||||||
|
DEPLOY_USER: ${{ secrets.DEPLOY_USER }}
|
||||||
|
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }}
|
||||||
|
steps:
|
||||||
|
- name: Install and update ssh + rsync
|
||||||
|
run: |
|
||||||
|
which rsync || ( apt update -y && apt install rsync -y)
|
||||||
|
which ssh-agent || ( apt update -y && apt install openssh-client -y)
|
||||||
|
- name: Install SSH Key
|
||||||
|
uses: https://github.com/shimataro/ssh-key-action@v2
|
||||||
|
with:
|
||||||
|
key: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||||
|
known_hosts: unnecessary
|
||||||
|
- name: Adding Known Hosts
|
||||||
|
run: ssh-keyscan -H ${{ secrets.DEPLOY_HOST }} >> ~/.ssh/known_hosts
|
||||||
- name: Start new screen session
|
- name: Start new screen session
|
||||||
uses: https://github.com/appleboy/ssh-action@master
|
uses: https://github.com/appleboy/ssh-action@master
|
||||||
with:
|
with:
|
||||||
|
@ -79,5 +107,4 @@ jobs:
|
||||||
script: |
|
script: |
|
||||||
PATH="$HOME/.local/bin:$PATH"
|
PATH="$HOME/.local/bin:$PATH"
|
||||||
cd fgo-ta_com
|
cd fgo-ta_com
|
||||||
find public -maxdepth 1 -printf "%p\n"
|
|
||||||
screen -S fgo-ta_com-public -dm serve public/ -p ${{ secrets.DEPLOY_TARGET_PORT }}
|
screen -S fgo-ta_com-public -dm serve public/ -p ${{ secrets.DEPLOY_TARGET_PORT }}
|
||||||
|
|
Loading…
Reference in a new issue