Merge branch 'main' of github.com:Xceptance/xlt-documentation #316
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: Deploy documentation | |
| on: | |
| push: | |
| branches: | |
| - main # Set a branch to deploy | |
| workflow_dispatch: | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod | |
| submodules: true # Fetch Hugo themes/modules | |
| # 👇 NEW STEP: Setup Node.js Environment | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' # Use a recent stable LTS version | |
| # 👇 NEW STEP: Install PostCSS and other Node dependencies | |
| - name: Install Node.js Dependencies | |
| run: npm ci | |
| # `npm ci` (clean install) is faster and better for CI environments than `npm install` | |
| - name: Setup Hugo | |
| uses: peaceiris/actions-hugo@v3 | |
| with: | |
| hugo-version: '0.152.2' | |
| extended: true | |
| - name: Cache Hugo modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: /tmp/hugo_cache | |
| key: ${{ runner.os }}-hugo-${{ hashFiles('**/go.sum') }} | |
| restore-keys: | | |
| ${{ runner.os }}-hugo- | |
| - name: Build the documentation | |
| env: | |
| HUGO_CACHEDIR: /tmp/hugo_cache | |
| run: hugo --gc --minify | |
| - name: Install lftp | |
| run: sudo apt-get install lftp | |
| - name: Mirror the documentation on the FTP | |
| run: .github/workflows/scripts/mirrorftp ${{ secrets.FTP_USERNAME }} ${{ secrets.FTP_PASSWORD }} ${{ secrets.FTP_HOST }} |