-
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.
[Actions] ⚡ Optimize workflows (#3480)
* 🚚 Moved auth-token, fetch less history * ♻️ Use composite actions for workflow * 🐛 Checkout before running composite workflow * 🚚 Move composite actions to separate dir * ♻️ Pass token to composite action * 📝 Better test names * ⚡ Optimize chromatic workflow * ⚰️ Removed old and broken redeploy action * ⚡ Optimized website-build * ♻️ Use composite actions for prod and dev build * ⚡ Reduced e2e tests by 40% * ⚡ Improved sandbox testing * ⚡ Update search-tests * 🐛 Disable invalid example-demos * 🐛 Wait for search completion * 📝 removed old env input * 🐛 Moved vars out to input * 🐛 Don't ignore inputs for if-tests * 🐛 Check input for truuthynes * test: Run sharded playwright * 🐛 Removed sharded workflow * ⚡ Update re-use of actions * 🐛 Keep full git-history for chroamtic * Update .github/workflows/chromatic.yml Co-authored-by: Lars Eirik Korsgaard Hansen <[email protected]> * Update .github/workflows/referansesider-spa-deploy.yml Co-authored-by: Lars Eirik Korsgaard Hansen <[email protected]> * Update .github/workflows/ci.yml Co-authored-by: Lars Eirik Korsgaard Hansen <[email protected]> * Update .github/workflows/ci.yml Co-authored-by: Lars Eirik Korsgaard Hansen <[email protected]> * Update .github/workflows/ci.yml Co-authored-by: Lars Eirik Korsgaard Hansen <[email protected]> * Update .github/workflows/ci.yml Co-authored-by: Lars Eirik Korsgaard Hansen <[email protected]> * Update .github/workflows/ci.yml Co-authored-by: Lars Eirik Korsgaard Hansen <[email protected]> * Update .github/workflows/ci.yml Co-authored-by: Lars Eirik Korsgaard Hansen <[email protected]> * 📝 Typo * 📝 Typoo * ⚡ Use built-in report for playwright * 🐛 Use html-reporter, not list --------- Co-authored-by: Lars Eirik Korsgaard Hansen <[email protected]>
- Loading branch information
1 parent
fd6e2b4
commit a0ca882
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.