Skip to content

Commit

Permalink
✨ Deploy fonctionnel (#90)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahhj93 authored Jun 15, 2023
1 parent 709923f commit d86f1e1
Showing 1 changed file with 26 additions and 9 deletions.
35 changes: 26 additions & 9 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,41 @@ on:
types: [created]

jobs:
reboot:
deploy:
runs-on: ubuntu-latest

steps:
- name: Update production branch
- name: Set up Git
run: |
git checkout production
git rebase main
git push origin production
- name: Clone repository
git config --global user.email "${{ secrets.GIT_EMAIL }}"
git config --global user.name "${{ secrets.GIT_NAME }}"
- name: Checkout repository
uses: actions/checkout@v2

- name: Reset production branch to main
run: |
git fetch origin
git checkout production
git reset --hard origin/main
git push -f origin production
- name: Clone repository on SSH server
uses: appleboy/ssh-action@v0.1.4
with:
ref: production
path: /root
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USERNAME }}
password: ${{ secrets.SERVER_PASSWORD }}
script: |
cd /root/
rm -rf Marmit65
git clone --branch production https://github.com/HowlingByte/Marmit65
- name: Reboot server
uses: appleboy/ssh-action@v0.1.4
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USERNAME }}
password: ${{ secrets.SSH_PASSWORD }}
password: ${{ secrets.SERVER_PASSWORD }}
script: |
sudo reboot

0 comments on commit d86f1e1

Please sign in to comment.