Update quick-start.md #59
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: publish-prod | |
| on: | |
| push: | |
| branches: | |
| - master | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: self-hosted | |
| env: | |
| PRODUCT: conversion | |
| WORK_DIR: docs-cloud-common | |
| PUBLIC_DIR: docs-cloud-common/public | |
| REMOTE_DIR: /var/www/docs.groupdocs.cloud/html | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Submodule update | |
| run: | | |
| rm -rf ${{ env.WORK_DIR }} | |
| git submodule update --init --recursive | |
| git submodule foreach git pull origin master | |
| - name: Install tools | |
| run: | | |
| curl -LO https://github.com/gohugoio/hugo/releases/download/v0.101.0/hugo_extended_0.101.0_Linux-64bit.deb | |
| sudo dpkg -i hugo_extended_0.101.0_Linux-64bit.deb | |
| sudo apt install xmlstarlet | |
| - name: Run and build Hugo | |
| run: | | |
| # Copy content | |
| cp -r content/* ${{ env.WORK_DIR }}/content/ | |
| hugo --source ${{ env.WORK_DIR }} --minify --config config-geekdoc.toml | |
| # Read root URL from the config file | |
| rootUrl=$(sed -n -e '/^baseURL/p' ${{ env.WORK_DIR }}/config-geekdoc.toml | sed 's/baseURL//; s/\s*//g; s/=//; s/"//g') | |
| # Create pattern to search for `storage` or `total` pages | |
| pattern="//*[*[contains(text(),'${rootUrl}storage') or contains(text(),'${rootUrl}total')]]" | |
| # Remove entries with `storage` and `total` substring | |
| xmlstarlet ed --inplace -d "$pattern" ${{ env.PUBLIC_DIR }}/product-sitemap.xml | |
| - name: Deploy sitemap | |
| uses: burnett01/rsync-deployments@7.0.1 | |
| with: | |
| switches: | |
| path: ${{ env.PUBLIC_DIR }}/product-sitemap.xml | |
| remote_path: ${{ env.REMOTE_DIR }}/sitemaps/${{ env.PRODUCT }}.xml | |
| remote_host: ${{ secrets.DOCS_SSH_HOST }} | |
| remote_user: ${{ secrets.DOCS_SSH_USER }} | |
| remote_key: ${{ secrets.DOCS_SSH_KEY }} | |
| - name: Deploy documentation | |
| uses: burnett01/rsync-deployments@7.0.1 | |
| with: | |
| switches: -vzr --delete | |
| path: ${{ env.PUBLIC_DIR }}/${{ env.PRODUCT }} | |
| remote_path: ${{ env.REMOTE_DIR }} | |
| remote_host: ${{ secrets.DOCS_SSH_HOST }} | |
| remote_user: ${{ secrets.DOCS_SSH_USER }} | |
| remote_key: ${{ secrets.DOCS_SSH_KEY }} |