Compare commits
10 Commits
795886a30b
...
d7920883ce
Author | SHA1 | Date | |
---|---|---|---|
|
d7920883ce | ||
|
3c926ba81d | ||
|
ae95d232fe | ||
|
88de4d04e7 | ||
|
5510565efe | ||
|
fc7a704ea5 | ||
|
af25294c4a | ||
|
972e6876aa | ||
|
cfb8d83d00 | ||
|
779f9ced7a |
@ -7,9 +7,11 @@ jobs:
|
|||||||
container:
|
container:
|
||||||
image: alpine
|
image: alpine
|
||||||
steps:
|
steps:
|
||||||
- name: Install git and openssh
|
- name: Install packages
|
||||||
run: |
|
run: |
|
||||||
apk add --no-cache git openssh-client
|
apk add --no-cache git openssh-client nodejs
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
- name: Setup SSH
|
- name: Setup SSH
|
||||||
env:
|
env:
|
||||||
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
|
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||||
@ -20,18 +22,11 @@ jobs:
|
|||||||
echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa
|
echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa
|
||||||
chmod 600 ~/.ssh/id_rsa
|
chmod 600 ~/.ssh/id_rsa
|
||||||
ssh-keyscan -H $HOST1 >> ~/.ssh/known_hosts
|
ssh-keyscan -H $HOST1 >> ~/.ssh/known_hosts
|
||||||
- name: Deploy to first host
|
- name: Deploy to host
|
||||||
env:
|
env:
|
||||||
HOST1: ${{ secrets.HOST1 }}
|
HOST1: ${{ secrets.HOST1 }}
|
||||||
USER: ${{ secrets.USER }}
|
USER: ${{ secrets.USER }}
|
||||||
run: |
|
run: |
|
||||||
ssh $USER@$HOST1 'rm -rf /var/www/elia.network/html/*'
|
ssh $USER@$HOST1 'rm -rf /var/www/elia.network/html/*'
|
||||||
chmod -R 777 .
|
scp -r . $USER@$HOST1:/var/www/elia.network/html
|
||||||
scp -r . $USER@$HOST1:/var/www/elia.network/html/
|
|
||||||
ssh $USER@$HOST1 'rm -r /var/www/elia.network/html/.git*'
|
ssh $USER@$HOST1 'rm -r /var/www/elia.network/html/.git*'
|
||||||
- name: Reload Nginx
|
|
||||||
env:
|
|
||||||
HOST1: ${{ secrets.HOST1 }}
|
|
||||||
USER: ${{ secrets.USER }}
|
|
||||||
run: |
|
|
||||||
ssh $USER@$HOST1 'sudo systemctl reload nginx'
|
|
||||||
|
Loading…
Reference in New Issue
Block a user