Merge pull request #359 from rom-rb/patrons-banner #191
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: ci | |
| on: | |
| push: | |
| paths: | |
| - ".github/workflows/ci.yml" | |
| - "source/**" | |
| - "data/**" | |
| - "lib/**" | |
| - "config.rb" | |
| - "Gemfile.lock" | |
| - "package-lock.json" | |
| pull_request: | |
| branches: | |
| - "main" | |
| repository_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Clone | |
| uses: actions/checkout@v2 | |
| - name: Clone gh-pages | |
| uses: actions/checkout@v2 | |
| with: | |
| ref: gh-pages | |
| path: docs | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: "2.7" | |
| - name: Install latest bundler | |
| run: gem install bundler --no-document -v 2.4.22 | |
| - name: Bundle install | |
| run: | | |
| bundle config set without development | |
| bundle config path vendor/bundle | |
| bundle install --jobs 4 --retry 3 | |
| - name: Install Node | |
| uses: actions/setup-node@v1 | |
| with: | |
| node-version: "12.10.0" | |
| - name: Restore npm package cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.npm | |
| key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-node- | |
| - name: Install node modules | |
| run: npm install --prefer-offline --no-audit | |
| - name: Symlink project docsites | |
| run: bundle exec rake projects:symlink | |
| - name: Build Middleman site | |
| run: bundle exec middleman build --verbose | |
| - name: Check internal links | |
| run: bundle exec rake check_links:internal | |
| - name: Prepare build artifact | |
| if: (github.event_name == 'push' && contains(github.ref, 'main')) || github.event_name == 'repository_dispatch' | |
| run: mkdir build && tar cvzf build/docs.tar.gz --exclude ".git" ./docs | |
| - name: Upload build artifact | |
| if: github.event_name == 'push' && contains(github.ref, 'main') || github.event_name == 'repository_dispatch' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: build | |
| path: build/docs.tar.gz | |
| deploy: | |
| runs-on: ubuntu-latest | |
| if: (github.event_name == 'push' && contains(github.ref, 'main')) || github.event_name == 'repository_dispatch' | |
| needs: build | |
| steps: | |
| - name: Clone | |
| uses: actions/checkout@v2 | |
| - name: Download the build artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: build | |
| - name: Extract the build | |
| run: tar xvf docs.tar.gz | |
| - name: Deploy to GitHub Pages | |
| uses: peaceiris/actions-gh-pages@v3 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./docs |