forked from tekdi/ubi-vc-issuance-mw
-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (30 loc) · 1.07 KB
/
uat-deployment.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
name: Deploy to UAT
on:
workflow_dispatch:
jobs:
Deploy:
name: Deploy to UAT
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Deploy to UAT
uses: easingthemes/ssh-deploy@main
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_KEY_UAT }}
REMOTE_HOST: ${{ secrets.HOST_NAME_UAT }}
REMOTE_USER: ${{ secrets.USERNAME_UAT }}
- name: Set up SSH key
run: |
mkdir -p ~/.ssh
echo "${{ secrets.SSH_KEY_UAT }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
# Add the SSH key to the known_hosts file (replace hostname with your actual hostname)
ssh-keyscan -H ${{ secrets.HOST_NAME_UAT}} >> ~/.ssh/known_hosts
sudo apt-get install sshpass
- name: Deploy to server
run: |
sshpass -p '${{ secrets.SSH_KEY_UAT }}' ssh -v -o StrictHostKeyChecking=no ${{ secrets.USERNAME_UAT }}@${{ secrets.HOST_NAME_UAT }} <<'ENDSSH'
cd ${{ secrets.TARGET_UAT_DIR }}
./deploy.sh
ENDSSH