Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 0 additions & 54 deletions .github/workflows/branch_deploy.yml

This file was deleted.

20 changes: 10 additions & 10 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
if: ${{ github.event_name == 'pull_request' }}
steps:
- name: Git clone repository
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Set up environment
uses: ./.github/actions/prepare-environment
Expand All @@ -32,7 +32,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Git clone repository
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Set up environment
uses: ./.github/actions/prepare-environment
Expand All @@ -46,7 +46,7 @@ jobs:
ESLINT_JUNIT_OUTPUT: 'test-results/eslint/docs-site-results.xml'
steps:
- name: Git clone repository
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Set up environment
uses: ./.github/actions/prepare-environment
Expand All @@ -63,7 +63,7 @@ jobs:
if: ${{ github.actor != 'dependabot[bot]' }}
steps:
- name: Git clone repository
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Set up environment
uses: ./.github/actions/prepare-environment
Expand All @@ -87,11 +87,11 @@ jobs:
run: |
pnpm run test --ci --coverage --silent --no-cache --reporters=default --reporters=jest-junit --runInBand --testResultsProcessor=jest-sonar-reporter

- name: SonarCloud Scan
uses: defencedigital/design-system-sonarcloud-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# - name: SonarCloud Scan

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How come we need to turn this off?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Broken - we probably need a new token

# uses: defencedigital/design-system-sonarcloud-action@master
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

Test-e2e_docs-site:
runs-on: ubuntu-latest
Expand All @@ -103,7 +103,7 @@ jobs:
NEXT_PUBLIC_CONTENTFUL_ACCESS_TOKEN: ${{ secrets.NEXT_PUBLIC_CONTENTFUL_ACCESS_TOKEN }}
steps:
- name: Git clone repository
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Set up environment
uses: ./.github/actions/prepare-environment
Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/deploy-gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Deploy to GitHub Pages

on:
push:
branches:
- master
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: pages
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up environment
uses: ./.github/actions/prepare-environment

- name: Build and export site
env:
NEXT_PUBLIC_CONTENTFUL_SPACE_ID: ${{ secrets.NEXT_PUBLIC_CONTENTFUL_SPACE_ID }}
NEXT_PUBLIC_CONTENTFUL_ACCESS_TOKEN: ${{ secrets.NEXT_PUBLIC_CONTENTFUL_ACCESS_TOKEN }}
run: pnpm export

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./out

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
21 changes: 0 additions & 21 deletions netlify.toml

This file was deleted.

3 changes: 3 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ const withTM = require('next-transpile-modules')([
])

module.exports = withTM({
images: {
unoptimized: true,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this we didn't do this before?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unoptimized: true is required because GitHub Pages doesn’t support Next’s image optimizer

},
webpack(config) {
config.module.rules.push({
test: /\.svg$/i,
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"scripts": {
"dev": "next dev",
"build": "next build",
"export": "next build && next export",
Comment on lines 8 to +9

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does next export do that next build didn't?

"start": "next start",
"lint": "eslint . --ext .ts --ext .tsx",
"lint:ci": "eslint -f ./node_modules/eslint-junit/index.js . --ext .ts --ext .tsx",
Expand Down
1 change: 1 addition & 0 deletions public/CNAME
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docs.design-system.navy.digital.mod.uk

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this for GitHub pages configuration then?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apparently so but there's also an option in the web ui