Skip to content

Update Ruby version to 3.2.2 #427

Update Ruby version to 3.2.2

Update Ruby version to 3.2.2 #427

Workflow file for this run

---
on:
push:
branches:
- main
pull_request:
branches-ignore:
- gh-pages
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: standards-catalogue
steps:
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
- uses: ruby/setup-ruby@8a45918450651f5e4784b6031db26f4b9f76b251
with:
bundler-cache: true
ruby-version: 3.2
working-directory: standards-catalogue
- uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561
with:
node-version: '14'
- name: Cache node modules
uses: actions/cache@937d24475381cd9c75ae6db12cb4e79714b926ed
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: Prepare
# run: bundle update --bundler
- name: Test
run: bundle exec rspec
- name: Lint
run: bundle exec rubocop --parallel
- name: Validate files are schema compliant
run: bundle exec rake schema
- name: Build
run: bundle exec rake build
- name: Upload built site
uses: actions/upload-artifact@82c141cc518b40d92cc801eee768e7aafc9c2fa2
with:
name: site
path: standards-catalogue/build
retention-days: 1
publish:
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/main' }}
needs: build
permissions:
contents: write
defaults:
run:
working-directory: standards-catalogue
steps:
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
- uses: ruby/setup-ruby@8a45918450651f5e4784b6031db26f4b9f76b251
with:
bundler-cache: true
ruby-version: 3.2
working-directory: standards-catalogue
- name: Download built site
uses: actions/download-artifact@f023be2c48cc18debc3bacd34cb396e0295e2869
with:
name: site
path: standards-catalogue/build
# Checkout stripped-down gh-pages branch to a subdirectory, for publishing
- name: Checkout gh-pages branch
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
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"