Skip to content

Commit

Permalink
deploy action
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmed-gharghar committed Dec 9, 2024
1 parent 7c0f3e5 commit 56ef0bb
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 30 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
on:
push:
branches:
- master
workflow_dispatch:

jobs:
run_pull:
name: run pull
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: install ssh keys
# check this thread to understand why its needed:
# https://stackoverflow.com/a/70447517
run: |
install -m 600 -D /dev/null ~/.ssh/id_rsa
echo "${{ secrets.SSH_KEY }}" > ~/.ssh/id_rsa
ssh-keyscan -H ${{ secrets.SSH_HOST }} > ~/.ssh/known_hosts
- name: zip repo and deploy
run: |
zip -r server.zip .
scp server.zip ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:/home/${{secrets.SSH_USER}}/
ssh ${{secrets.SSH_USER}}@${{secrets.SSH_HOST}} "./deploy.sh"
- name: cleanup
run: rm -rf ~/.ssh
30 changes: 0 additions & 30 deletions .github/workflows/main.yml

This file was deleted.

0 comments on commit 56ef0bb

Please sign in to comment.