Skip to content

Commit d86f1e1

Browse files
authored
✨ Deploy fonctionnel (#90)
1 parent 709923f commit d86f1e1

File tree

1 file changed

+26
-9
lines changed

1 file changed

+26
-9
lines changed

.github/workflows/deploy.yml

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,41 @@ on:
55
types: [created]
66

77
jobs:
8-
reboot:
8+
deploy:
99
runs-on: ubuntu-latest
10+
1011
steps:
11-
- name: Update production branch
12+
- name: Set up Git
1213
run: |
13-
git checkout production
14-
git rebase main
15-
git push origin production
16-
- name: Clone repository
14+
git config --global user.email "${{ secrets.GIT_EMAIL }}"
15+
git config --global user.name "${{ secrets.GIT_NAME }}"
16+
17+
- name: Checkout repository
1718
uses: actions/checkout@v2
19+
20+
- name: Reset production branch to main
21+
run: |
22+
git fetch origin
23+
git checkout production
24+
git reset --hard origin/main
25+
git push -f origin production
26+
27+
- name: Clone repository on SSH server
28+
uses: appleboy/[email protected]
1829
with:
19-
ref: production
20-
path: /root
30+
host: ${{ secrets.SERVER_HOST }}
31+
username: ${{ secrets.SERVER_USERNAME }}
32+
password: ${{ secrets.SERVER_PASSWORD }}
33+
script: |
34+
cd /root/
35+
rm -rf Marmit65
36+
git clone --branch production https://github.com/HowlingByte/Marmit65
37+
2138
- name: Reboot server
2239
uses: appleboy/[email protected]
2340
with:
2441
host: ${{ secrets.SERVER_HOST }}
2542
username: ${{ secrets.SERVER_USERNAME }}
26-
password: ${{ secrets.SSH_PASSWORD }}
43+
password: ${{ secrets.SERVER_PASSWORD }}
2744
script: |
2845
sudo reboot

0 commit comments

Comments
 (0)