Skip to content

Commit

Permalink
use node-version-file in github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
rmccar committed Nov 6, 2023
1 parent 5e004da commit d68c25c
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 49 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/lighthouse-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,10 @@ jobs:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Read .nvmrc file
id: read-nvmrc-file
run: echo "nvmrc=$(cat .nvmrc)" >> $GITHUB_OUTPUT
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: "${{ steps.read-nvmrc-file.outputs.nvmrc }}"
node-version-file: ".nvmrc"
- name: Install dependencies
run: yarn install
- name: Build pages
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/macro-and-script-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,10 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Read .nvmrc file
id: read-nvmrc-file
run: echo "nvmrc=$(cat .nvmrc)" >> $GITHUB_OUTPUT
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: "${{ steps.read-nvmrc-file.outputs.nvmrc }}"
node-version-file: ".nvmrc"
- name: Install dependencies
run: yarn install
- name: Run macro and script tests
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/npm-bundle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,14 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Read .nvmrc file
id: read-nvmrc-file
run: echo "nvmrc=$(cat .nvmrc)" >> $GITHUB_OUTPUT
- name: Use Node.js
uses: actions/checkout@v3
with:
ref: ${{ github.event.release.target_commitish }}
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: "${{ steps.read-nvmrc-file.outputs.nvmrc }}"
node-version-file: ".nvmrc"
registry-url: https://registry.npmjs.org/
- run: yarn install
- run: git config --global user.name "${{ github.actor }}"
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Read .nvmrc file
id: read-nvmrc-file
run: echo "nvmrc=$(cat .nvmrc)" >> $GITHUB_OUTPUT
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: "${{ steps.read-nvmrc-file.outputs.nvmrc }}"
node-version-file: ".nvmrc"
- name: Install dependencies
run: yarn install
- name: Build templates
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/visual-regression-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,10 @@ jobs:
with:
lfs: true
url: https://github.com/ONSdigital/design-system.git
- name: Read .nvmrc file
id: read-nvmrc-file
run: echo "nvmrc=$(cat .nvmrc)" >> $GITHUB_OUTPUT
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: "${{ steps.read-nvmrc-file.outputs.nvmrc }}"
node-version-file: ".nvmrc"
- name: Install dependencies
run: yarn install
- name: Install Docker
Expand Down
58 changes: 29 additions & 29 deletions src/layout/_template.njk
Original file line number Diff line number Diff line change
Expand Up @@ -138,42 +138,42 @@
{% endblock %}
{% block header %}
{{
onsHeader({
"wide": pageConfig.wide,
"fullWidth": pageConfig.fullWidth,
"language": pageConfig.header.language,
"button": pageConfig.header.signoutButton,
"toggleNavigationButton": pageConfig.header.toggleNavigationButton,
"navigation": pageConfig.header.navigation,
"siteSearchAutosuggest": pageConfig.header.siteSearchAutosuggest,
"browserBanner": pageConfig.header.browserBanner,
"phase": pageConfig.header.phase,
"assetsURL": assetsURL,
"serviceLinks": pageConfig.header.serviceLinks,
"variants": pageConfig.header.variants,
"classes": pageConfig.header.classes,
"mastheadLogo": pageConfig.header.mastheadLogo,
"mastheadLogoUrl": pageConfig.header.mastheadLogoUrl,
"titleUrl": pageConfig.header.titleUrl,
"title": pageConfig.header.title | default(pageConfig.title),
"description": pageConfig.header.description,
"titleAsH1": pageConfig.header.titleAsH1,
"titleLogo": pageConfig.header.titleLogo
})
}}
onsHeader({
"wide": pageConfig.wide,
"fullWidth": pageConfig.fullWidth,
"language": pageConfig.header.language,
"button": pageConfig.header.signoutButton,
"toggleNavigationButton": pageConfig.header.toggleNavigationButton,
"navigation": pageConfig.header.navigation,
"siteSearchAutosuggest": pageConfig.header.siteSearchAutosuggest,
"browserBanner": pageConfig.header.browserBanner,
"phase": pageConfig.header.phase,
"assetsURL": assetsURL,
"serviceLinks": pageConfig.header.serviceLinks,
"variants": pageConfig.header.variants,
"classes": pageConfig.header.classes,
"mastheadLogo": pageConfig.header.mastheadLogo,
"mastheadLogoUrl": pageConfig.header.mastheadLogoUrl,
"titleUrl": pageConfig.header.titleUrl,
"title": pageConfig.header.title | default(pageConfig.title),
"description": pageConfig.header.description,
"titleAsH1": pageConfig.header.titleAsH1,
"titleLogo": pageConfig.header.titleLogo
})
}}
{% endblock %}
{% block pageContent %}
<div class="ons-page__container ons-container{{ containerClasses }}">
{% block preMain %}
{% if pageConfig.breadcrumbs %}
{% from "components/breadcrumbs/_macro.njk" import onsBreadcrumbs %}
{{
onsBreadcrumbs({
"id": pageConfig.breadcrumbs.id,
"ariaLabel": pageConfig.breadcrumbs.ariaLabel,
"itemsList": pageConfig.breadcrumbs.itemsList
})
}}
onsBreadcrumbs({
"id": pageConfig.breadcrumbs.id,
"ariaLabel": pageConfig.breadcrumbs.ariaLabel,
"itemsList": pageConfig.breadcrumbs.itemsList
})
}}
{% endif %}
{% endblock %}
<div class="ons-grid">
Expand Down

0 comments on commit d68c25c

Please sign in to comment.