This commit is contained in:
+19
-12
@@ -17,15 +17,22 @@ jobs:
|
|||||||
- name: Generate HTML
|
- name: Generate HTML
|
||||||
run: pandoc index.md -s -o index.html --css styles.css
|
run: pandoc index.md -s -o index.html --css styles.css
|
||||||
|
|
||||||
- name: Deploy to server via SSH
|
- name: Setup SSH key
|
||||||
uses: appleboy/ssh-action@v1.2.0
|
run: |
|
||||||
with:
|
mkdir -p ~/.ssh
|
||||||
host: ${{ secrets.SSH_HOST }}
|
echo "${{ secrets.SSH_KEY }}" > ~/.ssh/id_ed25519
|
||||||
username: ${{ secrets.SSH_USER }}
|
chmod 600 ~/.ssh/id_ed25519
|
||||||
key: ${{ secrets.SSH_KEY }}
|
|
||||||
port: ${{ secrets.SSH_PORT || '22' }}
|
- name: Deploy to server via rsync
|
||||||
script: |
|
run: |
|
||||||
git clone https://tea.ahmza.com/ahmza/ahmza-dad.git /home/${{ secrets.SSH_USER }}/repo
|
rsync -avz --delete \
|
||||||
cp /home/${{ secrets.SSH_USER }}/repo/index.html /usr/share/nginx/html/
|
-e "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" \
|
||||||
cp /home/${{ secrets.SSH_USER }}/repo/styles.css /usr/share/nginx/html/
|
--exclude='.git' \
|
||||||
nginx -s reload
|
index.html styles.css nginx.conf \
|
||||||
|
${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:/usr/share/nginx/html/
|
||||||
|
|
||||||
|
- name: Reload nginx
|
||||||
|
run: |
|
||||||
|
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
|
||||||
|
${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} \
|
||||||
|
"nginx -s reload"
|
||||||
|
|||||||
Reference in New Issue
Block a user