-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
37 changed files
with
362 additions
and
485 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: "Build website" | ||
description: "Builds Nextjs-website and published CDN-asssets to GCP if needed" | ||
inputs: | ||
use_cdn_assets: | ||
description: "Use CDN assets, and upload build to GCP" | ||
required: true | ||
npm_auth_token: | ||
description: "NPM Auth Token" | ||
required: true | ||
nais_id_provider: | ||
description: "NAIS_WORKLOAD_IDENTITY_PROVIDER token" | ||
required: true | ||
nais_project_id: | ||
description: "NAIS_MANAGEMENT_PROJECT_ID token" | ||
required: true | ||
sanity_read_token: | ||
description: "Sanity read-only token allowing published and un-published documents" | ||
required: true | ||
sanity_read_no_drafts_token: | ||
description: "Sanity read-only token allowing only published documents" | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Setup project | ||
uses: ./.github/actions/setup | ||
with: | ||
npm_auth_token: ${{ inputs.npm_auth_token }} | ||
|
||
- name: Run website tests | ||
run: yarn workspace website test | ||
shell: bash | ||
|
||
- name: Make Next.js app use CDN assets | ||
if: ${{ inputs.use_cdn_assets == 'true' }} | ||
run: | | ||
echo "USE_CDN_ASSETS=true" >> aksel.nav.no/website/.env | ||
shell: bash | ||
|
||
- name: Build Next.js website | ||
run: yarn build:next | ||
env: | ||
SANITY_READ: ${{ inputs.sanity_read_token }} | ||
SANITY_READ_NO_DRAFTS: ${{ inputs.sanity_read_no_drafts_token }} | ||
shell: bash | ||
|
||
- name: Upload static files to Nav CDN | ||
if: ${{ inputs.use_cdn_assets == 'true' }} | ||
uses: nais/deploy/actions/cdn-upload/v2@master | ||
with: | ||
team: designsystem | ||
source: ./aksel.nav.no/website/.next/static | ||
destination: "/website/_next" | ||
project_id: ${{ inputs.nais_project_id }} | ||
identity_provider: ${{ inputs.nais_id_provider }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: "Setup Project" | ||
description: "Checks out repo, sets up Node, installs dependencies and runs boot command." | ||
inputs: | ||
npm_auth_token: | ||
description: "NPM Auth Token" | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: lts/* | ||
cache: yarn | ||
cache-dependency-path: "**/yarn.lock" | ||
|
||
- name: Install dependencies | ||
run: yarn | ||
shell: bash | ||
env: | ||
NPM_AUTH_TOKEN: ${{ inputs.npm_auth_token }} | ||
|
||
- name: Boot (build packages) | ||
run: yarn boot | ||
shell: bash |
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
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
This file was deleted.
Oops, something went wrong.
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
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
Oops, something went wrong.