mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-01-31 09:09:00 +03:00
Allow better customisation of autodeploy through secrets and variables (#102)
The production environment and host are ready for this PR Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
This commit is contained in:
parent
5fd116d0e2
commit
4ccf40bf35
1 changed files with 12 additions and 9 deletions
21
.github/workflows/build-push.yml
vendored
21
.github/workflows/build-push.yml
vendored
|
@ -21,7 +21,9 @@ jobs:
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Publish solution
|
- name: Publish solution
|
||||||
run: dotnet publish -c Release -r linux-x64 --no-self-contained -p:PublishReadyToRun=true
|
run: dotnet publish $PUBLISH_FLAGS
|
||||||
|
env:
|
||||||
|
PUBLISH_FLAGS: ${{vars.PUBLISH_FLAGS}}
|
||||||
|
|
||||||
- name: Setup SSH key
|
- name: Setup SSH key
|
||||||
run: |
|
run: |
|
||||||
|
@ -33,29 +35,30 @@ jobs:
|
||||||
SSH_PRIVATE_KEY: ${{secrets.SSH_PRIVATE_KEY}}
|
SSH_PRIVATE_KEY: ${{secrets.SSH_PRIVATE_KEY}}
|
||||||
SSH_HOST: ${{secrets.SSH_HOST}}
|
SSH_HOST: ${{secrets.SSH_HOST}}
|
||||||
|
|
||||||
- name: Quit currently running instance
|
- name: Stop currently running instance
|
||||||
continue-on-error: true
|
|
||||||
run: |
|
run: |
|
||||||
ssh $SSH_USER@$SSH_HOST pkill --signal SIGQUIT Boyfriend
|
ssh $SSH_USER@$SSH_HOST $STOP_COMMAND
|
||||||
shell: bash
|
shell: bash
|
||||||
env:
|
env:
|
||||||
SSH_USER: ${{secrets.SSH_USER}}
|
SSH_USER: ${{secrets.SSH_USER}}
|
||||||
SSH_HOST: ${{secrets.SSH_HOST}}
|
SSH_HOST: ${{secrets.SSH_HOST}}
|
||||||
|
STOP_COMMAND: ${{vars.STOP_COMMAND}}
|
||||||
|
|
||||||
- name: Upload published solution
|
- name: Upload published solution
|
||||||
run: |
|
run: |
|
||||||
scp -r bin/Release/net7.0/linux-x64/publish/* $SSH_USER@$SSH_HOST:$UPLOAD_DESTINATION
|
scp -r $UPLOAD_FROM $SSH_USER@$SSH_HOST:$UPLOAD_TO
|
||||||
shell: bash
|
shell: bash
|
||||||
env:
|
env:
|
||||||
SSH_USER: ${{secrets.SSH_USER}}
|
SSH_USER: ${{secrets.SSH_USER}}
|
||||||
SSH_HOST: ${{secrets.SSH_HOST}}
|
SSH_HOST: ${{secrets.SSH_HOST}}
|
||||||
UPLOAD_DESTINATION: ${{secrets.UPLOAD_DESTINATION}}
|
UPLOAD_FROM: ${{vars.UPLOAD_FROM}}
|
||||||
|
UPLOAD_TO: ${{vars.UPLOAD_TO}}
|
||||||
|
|
||||||
- name: Start uploaded solution
|
- name: Start new instance
|
||||||
run: |
|
run: |
|
||||||
ssh $SSH_USER@$SSH_HOST $COMMAND
|
ssh $SSH_USER@$SSH_HOST $START_COMMAND
|
||||||
shell: bash
|
shell: bash
|
||||||
env:
|
env:
|
||||||
SSH_USER: ${{secrets.SSH_USER}}
|
SSH_USER: ${{secrets.SSH_USER}}
|
||||||
SSH_HOST: ${{secrets.SSH_HOST}}
|
SSH_HOST: ${{secrets.SSH_HOST}}
|
||||||
COMMAND: ${{secrets.COMMAND}}
|
START_COMMAND: ${{vars.START_COMMAND}}
|
||||||
|
|
Loading…
Reference in a new issue