docs: Migrate v2 website deployment #2257
Workflow file for this run
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: Website URLs | |
| on: | |
| pull_request: | |
| branches: ["*"] | |
| paths: | |
| - docs/** | |
| - .github/workflows/test-website-links.yml | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| defaults: | |
| run: | |
| working-directory: docs | |
| env: | |
| BUNDLE_GEMFILE: ${{github.workspace}}/docs/Gemfile | |
| JEKYLL_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| steps: | |
| - name: Checkout source | |
| uses: actions/checkout@v7 | |
| - name: Setup Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: 3.3 | |
| bundler-cache: true | |
| - name: Install dependencies | |
| run: gem install html-proofer | |
| - name: Replace "data-src" | |
| run: sed -i 's/data-src/src/g' pages/home.md | |
| - name: Use 'localhost' | |
| uses: jacobtomlinson/gha-find-replace@v3 | |
| with: | |
| find: "https://v2.dotnet.stockindicators.dev" | |
| replace: "http://127.0.0.1:4000" | |
| regex: false | |
| - name: Build site | |
| env: | |
| RUBYOPT: "-r ${{ github.workspace }}/docs/_plugins/liquid_ruby32_patch.rb" | |
| run: bundle exec jekyll build | |
| - name: Serve site | |
| env: | |
| RUBYOPT: "-r ${{ github.workspace }}/docs/_plugins/liquid_ruby32_patch.rb" | |
| run: bundle exec jekyll serve --port 4000 --detach | |
| - name: Test for broken URLs | |
| run: > | |
| htmlproofer _site | |
| --no-enforce-https | |
| --no-check-external-hash | |
| --ignore-status-codes "0,302,402,403,406,408,415,429,503,999" | |
| --ignore-urls "/fonts.gstatic.com/" | |
| - name: Kill site (failsafe) | |
| if: always() | |
| run: pkill -f jekyll |