-
Notifications
You must be signed in to change notification settings - Fork 8
39 lines (31 loc) · 1.15 KB
/
bash__deploy-docker.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: Deploy Docker with bash file
on:
workflow_run:
workflows: ['Build and push Docker - disabled']
types:
- completed
workflow_dispatch:
env:
IMAGE_NAME_WITH_TAG: ${{ secrets.DOCKER_USERNAME }}/${{ github.event.repository.name }}:latest
jobs:
deploy:
name: Deploy image from Dockerhub to remote host with ssh
runs-on: ubuntu-latest
steps:
- name: Set up SSH config
run: |
# Set up SSH key
mkdir -p ~/.ssh
echo "${{ secrets.REMOTE_KEY_ED25519 }}" > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
# Set up SSH config
echo "Host arm1" > ~/.ssh/config
echo " HostName ${{ secrets.REMOTE_HOST }}" >> ~/.ssh/config
echo " User ${{ secrets.REMOTE_USERNAME }}" >> ~/.ssh/config
echo " IdentityFile ~/.ssh/id_ed25519" >> ~/.ssh/config
echo " Port ${{ secrets.REMOTE_PORT }}" >> ~/.ssh/config
chmod 600 ~/.ssh/config
# Add SSH server key to known_hosts
ssh-keyscan -H ${{ secrets.REMOTE_HOST }} >> ~/.ssh/known_hosts
- name: Run bash file with yarn
run: yarn deploy:docker