|
1 | | -# workflow for rendering and uploads webxdc docs |
| 1 | +# workflow for rendering and uploads webxdc docs |
2 | 2 |
|
3 | | -name: Render and upload webxdc docs |
| 3 | +name: Render and upload webxdc docs |
4 | 4 |
|
5 | | -# Controls when the workflow will run |
6 | 5 | on: |
7 | | - # Triggers the workflow on push or pull request events but only for the master branch |
8 | 6 | push: |
9 | | - branches: |
| 7 | + branches: |
10 | 8 | - main |
11 | | - |
12 | | - # Allows you to run this workflow manually from the Actions tab |
13 | 9 | workflow_dispatch: |
14 | 10 |
|
15 | | -# A workflow run is made up of one or more jobs that can run sequentially or in parallel |
16 | 11 | jobs: |
17 | | - # This workflow contains a single job called "build" |
18 | 12 | build: |
19 | | - # The type of runner that the job will run on |
20 | 13 | runs-on: ubuntu-latest |
21 | 14 |
|
22 | | - # Steps represent a sequence of tasks that will be executed as part of the job |
23 | 15 | steps: |
24 | | - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it |
25 | | - - uses: actions/checkout@v2 |
| 16 | + - name: Checkout code |
| 17 | + uses: actions/checkout@v4 |
26 | 18 |
|
27 | | - - uses: actions-rs/toolchain@v1 |
28 | | - with: |
29 | | - profile: minimal |
30 | | - toolchain: stable |
31 | | - override: true |
| 19 | + - name: Setup mdBook |
| 20 | + run: | |
| 21 | + MDBOOK_VERSION="0.4.40" |
| 22 | + curl -sSL "https://github.com/rust-lang/mdBook/releases/download/v${MDBOOK_VERSION}/mdbook-v${MDBOOK_VERSION}-x86_64-unknown-linux-gnu.tar.gz" | tar -xz |
| 23 | + sudo mv mdbook /usr/local/bin/ |
32 | 24 |
|
33 | | - - name: Rust Cache |
34 | | - uses: Swatinem/rust-cache@v1.3.0 |
| 25 | + - name: Install mdbook-linkcheck |
| 26 | + run: | |
| 27 | + curl -sSL "https://github.com/Michael-F-Bryan/mdbook-linkcheck/releases/latest/download/mdbook-linkcheck.x86_64-unknown-linux-gnu.zip" -o mdbook-linkcheck.zip |
| 28 | + unzip mdbook-linkcheck.zip mdbook-linkcheck |
| 29 | + chmod +x mdbook-linkcheck |
| 30 | + sudo mv mdbook-linkcheck /usr/local/bin/ |
35 | 31 |
|
36 | | - - name: install mdbook |
| 32 | + - name: Build docs |
37 | 33 | run: | |
38 | | - cargo install mdbook --vers "^0.4" |
39 | | - cargo install mdbook-linkcheck |
40 | | - cd src-docs |
| 34 | + cd src-docs |
41 | 35 | mdbook build |
42 | | - mv book/html ../website/docs |
| 36 | + mkdir -p ../website/docs |
| 37 | + cp -r book/html/* ../website/docs/ |
| 38 | +
|
| 39 | + - name: Prepare website and apps |
| 40 | + run: | |
| 41 | + # Ensure website/apps exists and copy contents |
| 42 | + mkdir -p website/apps |
| 43 | + cp -r apps/* website/apps/ |
43 | 44 |
|
44 | | - - name: Upload website including docs and apps |
| 45 | + - name: Upload website including docs and apps |
45 | 46 | run: | |
46 | 47 | mkdir -p "$HOME/.ssh" |
47 | 48 | echo "${{ secrets.KEY }}" > "$HOME/.ssh/key" |
48 | 49 | chmod 600 "$HOME/.ssh/key" |
49 | | - mv apps website/ |
50 | | - rsync -avzh -e "ssh -i $HOME/.ssh/key -o StrictHostKeyChecking=no" "website/" "${{ secrets.USERNAME }}@delta.chat:/var/www/html/webxdc.org" |
| 50 | + # Rsync using the correct source and target |
| 51 | + rsync -avzh -e "ssh -i $HOME/.ssh/key -o StrictHostKeyChecking=no" "website/" "${{ secrets.USERNAME }}@delta.chat:/var/www/html/webxdc.org" |
0 commit comments