Bump textlint from 15.6.1 to 15.7.1 in the npm group (#2194) #1249
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: Build and deploy offline website | |
| on: | |
| push: | |
| branches: | |
| - master | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| name: Build offline website | |
| runs-on: ubuntu-24.04 | |
| env: | |
| CI: true | |
| WORKFLOW_GOOGLE_ANALYTICS_KEY: ${{ secrets.GOOGLE_ANALYTICS_KEY }} | |
| steps: | |
| - name: Setup Action | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Setup Node | |
| uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | |
| with: | |
| node-version: 20.x | |
| - name: Setup Python | |
| uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | |
| with: | |
| python-version: '3.x' | |
| - name: Install system dependencies for lxml | |
| run: sudo apt-get update && sudo apt-get install -y libxml2-dev libxslt1-dev | |
| - name: Install Python dependencies | |
| run: make install-python-requirements | |
| - name: Run build script | |
| run: cd scripts && bash Generate_Site_mkDocs.sh | |
| - name: List generated files | |
| run: ls -al generated/site/ | |
| - name: Create bundle | |
| run: cd generated && zip -r ../bundle.zip site | |
| - name: Test bundle | |
| run: zip -T bundle.zip | |
| - name: Upload bundle as artifact | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: Bundle | |
| path: bundle.zip | |
| deploy: | |
| name: Deploy offline website | |
| needs: build | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| env: | |
| CI: true | |
| steps: | |
| - name: Setup Action | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| fetch-depth: 0 # fetch all branches | |
| - name: Install dependencies | |
| run: sudo apt-get install -y unzip zip | |
| - name: Switch to offline website (gh-pages) branch | |
| run: git checkout gh-pages | |
| - name: Remove previous version website files | |
| run: | | |
| shopt -s extglob | |
| rm -rdfv !("CNAME"|"robots.txt"|"_config.yml") | |
| - name: Download new build from artifact | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | |
| with: | |
| name: Bundle | |
| - name: Display structure of downloaded files | |
| run: ls -R | |
| # - name: Replace bundle with new build | |
| # run: | | |
| # mv Bundle.zip bundle.zip | |
| # rm -rf Bundle 1>/dev/null 2>&1 | |
| - name: Test new bundle | |
| run: zip -T bundle.zip | |
| - name: Extract new bundle | |
| run: | | |
| unzip bundle.zip | |
| mv site/* . | |
| upd=`date +"%Y-%m-%d at %T"`; echo "Website last update: $upd." > README.md | |
| rm -rf site | |
| - name: Commit changes to gh-pages | |
| run: | | |
| git config --global user.email "action@github.com" | |
| git config --global user.name "GitHub Action" | |
| git add --all . | |
| git commit -a -m "Deploy the generated website via GitHub Actions" | |
| - name: Publish the build to gh-pages | |
| run: git push origin HEAD:gh-pages |