-
Notifications
You must be signed in to change notification settings - Fork 1
42 lines (39 loc) · 1.33 KB
/
gophercoders.yaml
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
40
41
42
name: GopherCoders_Build_And_Deploy
on: [push, pull_request]
jobs:
deploy:
name: "Deploy to senpaid"
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
steps:
- name Checkout
- uses: actions/checkout@v4
with:
path: 'gophercoders.com'
- name Listing
run: ls -al
run: ls -al ./gophercoders.com
- name: Configure SSH
run: |
mkdir -p ~/.ssh/
echo "$SSH_KEY" > ~/.ssh/gophercoders.key
chmod 600 ~/.ssh/gophercoders.key
cat >>~/.ssh/config <<END
Host gophercoders.com
HostName $SSH_HOST
User $SSH_USER
Port $SSH_PORT
IdentityFile ~/.ssh/gophercoders.key
StrictHostKeyChecking no
ProxyCommand openssl s_client -quiet -connect senpaid.com:$SSH_PORT -servername www.gophercoders.com
END
env:
SSH_KEY: ${{ secrets.SENPAID_SERVER_SSH_KEY }}
SSH_USER: ${{ secrets.SENPAID_SERVER_USERNAME }}
SSH_HOST: ${{ secrets.SENPAID_SERVER_HOSTNAME }}
SSH_PORT: ${{ secrets.SENPAID_SERVER_PORT }}
- name: List public dir
run: ssh gophercoders.com 'whoami; ls -l ~/public'
- name: Delete ssh dir
if: ${{ always() }}
run: rm -rf ~/.ssh