Merge pull request #918 from co-cddo/dependabot/bundler/rexml-3.3.6 #4376
This file contains 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
--- | |
on: | |
pull_request: | |
push: | |
branches-ignore: | |
- gh-pages | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 | |
- uses: ruby/setup-ruby@a6e6f86333f0a2523ece813039b8b4be04560854 | |
with: | |
bundler-cache: true | |
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b | |
with: | |
node-version: '16' | |
- name: Cache node modules | |
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 | |
env: | |
cache-name: cache-node-modules | |
with: | |
# npm cache files are stored in `~/.npm` on Linux/macOS | |
path: ~/.npm | |
key: npm-${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
npm-${{ runner.os }}-build-${{ env.cache-name }}- | |
npm-${{ runner.os }}-build- | |
npm- | |
- name: Install NPM dependencies | |
run: npm install | |
- name: Test | |
run: bundle exec rspec | |
- name: Lint | |
run: bundle exec rubocop --parallel | |
- name: Validate schema | |
run: bundle exec rake schema | |
- name: Build | |
run: bundle exec rake build | |
- name: Upload built site | |
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a | |
with: | |
name: site | |
path: build | |
retention-days: 1 | |
htmlproofer: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 | |
- uses: ruby/setup-ruby@a6e6f86333f0a2523ece813039b8b4be04560854 | |
with: | |
bundler-cache: true | |
- name: Download built site | |
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 | |
with: | |
name: site | |
path: build | |
- name: Test built site | |
run: bundle exec rake htmlproofer | |
publish: | |
runs-on: ubuntu-latest | |
if: ${{ github.ref == 'refs/heads/main' }} | |
needs: build | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 | |
- uses: ruby/setup-ruby@a6e6f86333f0a2523ece813039b8b4be04560854 | |
with: | |
bundler-cache: true | |
- name: Download built site | |
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 | |
with: | |
name: site | |
path: build | |
# Checkout stripped-down gh-pages branch to a subdirectory, for publishing | |
- name: Checkout gh-pages branch | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 | |
with: | |
ref: gh-pages | |
path: tmp/publish | |
- name: Publish | |
run: | | |
git config --global user.email "github-actions@github.com" | |
git config --global user.name "github-actions" | |
bundle exec rake publish CLONED_GH_PAGES_DIR="tmp/publish" |