mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-01-31 09:09:00 +03:00
Retrieve SSH port from environment secrets (#337)
Fixes current deployment failure due to use of non-standard SSH port on our production host. `ssh-keyscan` command was moved out to its own step to help troubleshooting in the future. Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
This commit is contained in:
parent
84dc248038
commit
8a42ecd1ab
1 changed files with 19 additions and 10 deletions
27
.github/workflows/build-push.yml
vendored
27
.github/workflows/build-push.yml
vendored
|
@ -39,30 +39,38 @@ jobs:
|
||||||
needs: upload-image
|
needs: upload-image
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Setup SSH key
|
- name: Copy SSH key
|
||||||
run: |
|
run: |
|
||||||
install -m 600 -D /dev/null ~/.ssh/id_ed25519
|
install -m 600 -D /dev/null ~/.ssh/id_ed25519
|
||||||
echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_ed25519
|
echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_ed25519
|
||||||
ssh-keyscan -H $SSH_HOST > ~/.ssh/known_hosts
|
shell: bash
|
||||||
shell: bash {0}
|
|
||||||
env:
|
env:
|
||||||
SSH_PRIVATE_KEY: ${{secrets.SSH_PRIVATE_KEY}}
|
SSH_PRIVATE_KEY: ${{secrets.SSH_PRIVATE_KEY}}
|
||||||
|
|
||||||
|
- name: Generate SSH known hosts file
|
||||||
|
run: |
|
||||||
|
ssh-keyscan -H $SSH_HOST -p $SSH_PORT > ~/.ssh/known_hosts
|
||||||
|
shell: bash
|
||||||
|
env:
|
||||||
SSH_HOST: ${{secrets.SSH_HOST}}
|
SSH_HOST: ${{secrets.SSH_HOST}}
|
||||||
|
SSH_PORT: ${{secrets.SSH_PORT}}
|
||||||
|
|
||||||
- name: Stop currently running instance
|
- name: Stop currently running instance
|
||||||
run: |
|
run: |
|
||||||
ssh $SSH_USER@$SSH_HOST $STOP_COMMAND
|
ssh -p $SSH_PORT $SSH_USER@$SSH_HOST $STOP_COMMAND
|
||||||
shell: bash {0}
|
shell: bash
|
||||||
env:
|
env:
|
||||||
|
SSH_PORT: ${{secrets.SSH_PORT}}
|
||||||
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}}
|
STOP_COMMAND: ${{vars.STOP_COMMAND}}
|
||||||
|
|
||||||
- name: Update Docker image
|
- name: Update Docker image
|
||||||
run: |
|
run: |
|
||||||
ssh $SSH_USER@$SSH_HOST docker pull ghcr.io/$NAMESPACE/$IMAGE_NAME:latest
|
ssh -p $SSH_PORT $SSH_USER@$SSH_HOST docker pull ghcr.io/$NAMESPACE/$IMAGE_NAME:latest
|
||||||
shell: bash {0}
|
shell: bash
|
||||||
env:
|
env:
|
||||||
|
SSH_PORT: ${{secrets.SSH_PORT}}
|
||||||
SSH_USER: ${{secrets.SSH_USER}}
|
SSH_USER: ${{secrets.SSH_USER}}
|
||||||
SSH_HOST: ${{secrets.SSH_HOST}}
|
SSH_HOST: ${{secrets.SSH_HOST}}
|
||||||
NAMESPACE: ${{vars.NAMESPACE}}
|
NAMESPACE: ${{vars.NAMESPACE}}
|
||||||
|
@ -70,9 +78,10 @@ jobs:
|
||||||
|
|
||||||
- name: Start new instance
|
- name: Start new instance
|
||||||
run: |
|
run: |
|
||||||
ssh $SSH_USER@$SSH_HOST $START_COMMAND
|
ssh -p $SSH_PORT $SSH_USER@$SSH_HOST $START_COMMAND
|
||||||
shell: bash {0}
|
shell: bash
|
||||||
env:
|
env:
|
||||||
|
SSH_PORT: ${{secrets.SSH_PORT}}
|
||||||
SSH_USER: ${{secrets.SSH_USER}}
|
SSH_USER: ${{secrets.SSH_USER}}
|
||||||
SSH_HOST: ${{secrets.SSH_HOST}}
|
SSH_HOST: ${{secrets.SSH_HOST}}
|
||||||
START_COMMAND: ${{vars.START_COMMAND}}
|
START_COMMAND: ${{vars.START_COMMAND}}
|
||||||
|
|
Loading…
Reference in a new issue