|
| 1 | +--- |
| 2 | +name: 📖 Zsh |
| 3 | + |
| 4 | +on: |
| 5 | + push: |
| 6 | + paths: |
| 7 | + - "wiki/zsh/**" |
| 8 | + pull_request: |
| 9 | + paths: |
| 10 | + - "wiki/zsh/**" |
| 11 | + workflow_dispatch: |
| 12 | + |
| 13 | +jobs: |
| 14 | + generate-documentation: |
| 15 | + runs-on: ubuntu-latest |
| 16 | + steps: |
| 17 | + - name: ⤵️ Check out code from GitHub |
| 18 | + uses: actions/checkout@v3 |
| 19 | + with: |
| 20 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 21 | + submodules: recursive |
| 22 | + - name: ⚡ Install zsdoc |
| 23 | + run: | |
| 24 | + sudo apt-get install -y zsh tree |
| 25 | + sudo make -C lib/zsdoc install |
| 26 | + - name: 💎 Setup Ruby |
| 27 | + uses: ruby/setup-ruby@v1 |
| 28 | + with: |
| 29 | + ruby-version: 3.0 |
| 30 | + bundler-cache: true |
| 31 | + - name: 📝 Install asciidoctor-pdf and rouge |
| 32 | + run: | |
| 33 | + gem install asciidoctor-pdf rouge |
| 34 | + - uses: actions/checkout@v3 |
| 35 | + with: |
| 36 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 37 | + - name: ♻️ Generate Documentation |
| 38 | + run: | |
| 39 | + make -C wiki/zsh clean |
| 40 | + make -C wiki/zsh all |
| 41 | + - name: ♻️ Compress the Zsh Documentation |
| 42 | + run: tar cvzf zsh-wiki.tar.gz wiki/zsh |
| 43 | + - name: Upload zsh-wiki.tar.gz |
| 44 | + uses: actions/upload-artifact@v3 |
| 45 | + with: |
| 46 | + name: ♻️ Zsh Documentation |
| 47 | + path: zsh-wiki.tar.gz |
| 48 | + - uses: actions/checkout@v3 |
| 49 | + - name: ♻️ Prepare GitHub Pages |
| 50 | + run: | |
| 51 | + make -C wiki/zsh prep-gh-pages |
| 52 | + git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" |
| 53 | + git config --local user.name "github-actions[bot]" |
| 54 | + git add code/zsh |
| 55 | + git commit --allow-empty -m "Zsh Documentation Update" -a |
| 56 | + - name: 📤 Push changes |
| 57 | + uses: ad-m/github-push-action@master |
| 58 | + with: |
| 59 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 60 | + branch: ${{ github.ref }} |
0 commit comments