Skip to content

Commit d1aabbf

Browse files
committed
Add a github workflow for master deployment
1 parent bc888ed commit d1aabbf

File tree

2 files changed

+75
-6
lines changed

2 files changed

+75
-6
lines changed

.github/workflows/deploy-dev.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: deploy-book-dev
2+
3+
# Only run this when the dev branch changes
4+
on:
5+
push:
6+
branches:
7+
- dev
8+
9+
# This job installs dependencies, builds the book, and pushes it to FTP server
10+
jobs:
11+
deploy-book-appr:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Set up Python
17+
uses: actions/setup-python@v5
18+
with:
19+
python-version: '3.13'
20+
21+
- name: Install dependencies
22+
run: |
23+
pip install -r requirements.txt
24+
working-directory: .
25+
26+
- name: Build the book
27+
run: |
28+
sphinx-build src/appr build -E
29+
working-directory: .
30+
31+
# Push the book's HTML to Infomaniak FTP
32+
- name: 📂 Sync files
33+
uses: SamKirkland/[email protected]
34+
with:
35+
server: 31826.ftp.infomaniak.com
36+
username: 31826_elliot
37+
password: ${{ secrets.FTP_PASSWORD }}
38+
local-dir: ./build/
39+
server-dir: sites/dev-apprendre.modulo-info.ch/
40+
41+
deploy-book-ens:
42+
runs-on: ubuntu-latest
43+
steps:
44+
- uses: actions/checkout@v4
45+
46+
- name: Set up Python
47+
uses: actions/setup-python@v5
48+
with:
49+
python-version: '3.13'
50+
51+
- name: Install dependencies
52+
run: |
53+
pip install -r requirements.txt
54+
working-directory: .
55+
56+
- name: Build the book
57+
run: |
58+
sphinx-build src/ens build -E
59+
working-directory: .
60+
61+
# Push the book's HTML to Infomaniak FTP
62+
- name: 📂 Sync files
63+
uses: SamKirkland/[email protected]
64+
with:
65+
server: 31826.ftp.infomaniak.com
66+
username: 31826_elliot
67+
password: ${{ secrets.FTP_PASSWORD }}
68+
local-dir: ./build/
69+
server-dir: sites/dev-enseigner.modulo-info.ch/

.github/workflows/main.yml renamed to .github/workflows/deploy.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
name: deploy-book
1+
name: deploy-book-master
22

33
# Only run this when the master branch changes
4-
on:
4+
on:
55
push:
6-
branches:
7-
- dev
6+
branches:
7+
- master
88

99
# This job installs dependencies, builds the book, and pushes it to FTP server
1010
jobs:
@@ -66,7 +66,7 @@ jobs:
6666
username: 31826_elliot
6767
password: ${{ secrets.FTP_PASSWORD }}
6868
local-dir: ./build/
69-
server-dir: sites/dev-apprendre.modulo-info.ch/
69+
server-dir: sites/apprendre.modulo-info.ch/
7070

7171
deploy-book-ens:
7272
runs-on: ubuntu-latest
@@ -96,4 +96,4 @@ jobs:
9696
username: 31826_elliot
9797
password: ${{ secrets.FTP_PASSWORD }}
9898
local-dir: ./build/
99-
server-dir: sites/dev-enseigner.modulo-info.ch/
99+
server-dir: sites/enseigner.modulo-info.ch/

0 commit comments

Comments
 (0)