|
1 |
| -# This workflow will install Python dependencies, run tests and lint with a variety of Python versions |
2 |
| -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions |
3 |
| - |
4 |
| -name: Create offline documentation to release |
| 1 | +name: Update documentation website |
5 | 2 |
|
6 | 3 | on:
|
7 | 4 | push:
|
8 |
| - branches: [ master ] |
| 5 | + branches: [ main ] |
9 | 6 | workflow_dispatch:
|
10 | 7 |
|
11 | 8 | jobs:
|
12 |
| - build: |
| 9 | + build-docs: |
| 10 | + name: "Generate HTML" |
| 11 | + if: ${{ github.repository_owner == 'Armbian' }} |
13 | 12 | runs-on: ubuntu-latest
|
14 |
| - strategy: |
15 |
| - matrix: |
16 |
| - python-version: [ 3.8 ] |
17 |
| - |
18 | 13 | steps:
|
| 14 | + |
19 | 15 | - uses: actions/checkout@v4
|
20 |
| - - name: Set up Python ${{ matrix.python-version }} |
| 16 | + with: |
| 17 | + ref: main |
| 18 | + fetch-depth: 1 |
| 19 | + |
| 20 | + - name: "Set up Python" |
21 | 21 | uses: actions/setup-python@v5
|
22 | 22 | with:
|
23 |
| - python-version: ${{ matrix.python-version }} |
24 |
| - - name: Install dependencies |
25 |
| - run: | |
26 |
| - python -m pip install --upgrade pip |
27 |
| - pip install setuptools wheel |
28 |
| - pip install -r requirements.txt |
29 |
| - - name: Run mkdocs --clean |
| 23 | + python-version: 3.8 |
| 24 | + |
| 25 | + - name: "Install dependencies" |
30 | 26 | run: |
|
31 |
| - mkdocs build --clean |
32 | 27 |
|
33 |
| - # - name: Upload pdf |
34 |
| - # uses: actions/upload-artifact@v4 |
35 |
| - # with: |
36 |
| - # name: artifact |
37 |
| - # path: site/pdf/document.pdf |
38 |
| -# PDF is not built, no need to upload |
| 28 | + pip install --upgrade pip |
| 29 | + pip install setuptools wheel -r requirements.txt |
| 30 | +
|
| 31 | + - name: "Build documentation" |
| 32 | + run: mkdocs build --clean |
| 33 | + |
| 34 | + - name: "Install SSH key" |
| 35 | + uses: shimataro/ssh-key-action@v2 |
| 36 | + with: |
| 37 | + key: ${{ secrets.KEY_UPLOAD }} |
| 38 | + known_hosts: ${{ secrets.HOST_APPLICATIONS_KNOWN_HOSTS }} |
| 39 | + if_key_exists: replace |
| 40 | + |
| 41 | + - name: "Deploy to servers" |
| 42 | + timeout-minutes: 3 |
| 43 | + run: | |
| 44 | + rsync -e "ssh -p ${{ secrets.HOST_APPLICATIONS_PORT }}" \ |
| 45 | + -a site/ \ |
| 46 | + ${{ secrets.HOST_APPLICATIONS_USER }}@${{ secrets.HOST_APPLICATIONS }}:storage/docs.armbian.com |
39 | 47 |
|
40 |
| - #deploy: |
41 |
| - #needs: [ build ] |
42 |
| - #runs-on: ubuntu-20.04 |
43 |
| - #env: |
44 |
| - # TZ: GMT |
45 |
| - #steps: |
46 |
| - # - uses: actions/checkout@v4 |
47 |
| - # - uses: actions/download-artifact@v4 |
48 |
| - # with: |
49 |
| - # name: artifact |
50 |
| - # - name: Add |
51 |
| - # run: | |
52 |
| - # ls -l |
53 |
| - # git pull |
54 |
| - # git add document.pdf |
55 |
| - # - name: Commit files |
56 |
| - # run: | |
57 |
| - # git config --local user.email "[email protected]" |
58 |
| - # git config --local user.name "Armbianworker" |
59 |
| - # git commit --allow-empty -m "Update github actions" -a |
60 |
| - # - name: Push changes |
61 |
| - # uses: ad-m/github-push-action@master |
62 |
| - # with: |
63 |
| - # repo-token: ${{ secrets.GITHUB_TOKEN }} |
64 |
| - # branch: ${{ github.ref }} |
65 |
| - #- name: Declare vars |
66 |
| - # id: vars |
67 |
| - # shell: bash |
68 |
| - # run: | |
69 |
| - # echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT |
70 |
| - # echo "timenow=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT |
71 |
| - #- name: Rename release artifact |
72 |
| - # shell: bash |
73 |
| - # run: | |
74 |
| - # mv -v document.pdf armbian-document-${{ steps.vars.outputs.sha_short }}.pdf |
75 |
| - #- name: Create Release |
76 |
| - # uses: ncipollo/release-action@v1 |
77 |
| - # with: |
78 |
| - # tag: ${{ steps.vars.outputs.sha_short }} |
79 |
| - # name: ${{ steps.vars.outputs.timenow }}-${{ steps.vars.outputs.sha_short }} |
80 |
| - # draft: false |
81 |
| - # prerelease: false |
82 |
| - # token: ${{ secrets.GITHUB_TOKEN }} |
83 |
| - # artifacts: armbian-document-${{ steps.vars.outputs.sha_short }}.pdf |
84 |
| - # artifactContentType: application/pdf |
0 commit comments