diff --git a/.github/workflows/generate-bs-images.yml b/.github/workflows/generate-bs-images.yml index fde54e395..ecaaf82cf 100644 --- a/.github/workflows/generate-bs-images.yml +++ b/.github/workflows/generate-bs-images.yml @@ -9,6 +9,9 @@ jobs: image: httpd:2.4 ports: - 8080:80 + permissions: + contents: read + packages: read steps: ## This clones and checks out. - name: Checkout branch diff --git a/.github/workflows/ocpl_cm_standards_check.yml b/.github/workflows/ocpl_cm_standards_check.yml index f86007368..94c8e2d08 100644 --- a/.github/workflows/ocpl_cm_standards_check.yml +++ b/.github/workflows/ocpl_cm_standards_check.yml @@ -7,3 +7,5 @@ on: jobs: commitlint_remote: uses: nciocpl/.github/.github/workflows/ocpl_cm_standards_check.yml@workflow/v2 + permissions: + contents: read diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index f822cf207..8f07b316e 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -21,6 +21,10 @@ jobs: image: httpd:2.4 ports: - 8080:80 + permissions: + contents: read + packages: read + pull-requests: write steps: ## Setup variables for build info - name: Set Variables @@ -133,6 +137,9 @@ jobs: ## be in netstorage for designsystem-dev. NOTE: this should **still** get ## set for production builds, but without the build_name. EXAMPLE_SITE_PUBLIC_PATH: ${{ format('/{0}/example-site', steps.set_vars.outputs.build_name) }} + ## The for dev cdn will be something like /cdn/pr-1234/ncids-css/ncids.min.css. + ## For prod the cdn will be something like /cdn/v3.4.0/ncids-css/ncids.min.css. + EXAMPLE_SITE_CDN_BASE_PATH: ${{ format('/cdn/{0}', steps.set_vars.outputs.build_name) }} ## This is used by the SitewideSearchApp and NEEDs to be the path that will ultimately ## be in netstorage for designsystem-dev. NOTE: this should **still** get ## set for production builds, but without the build_name. @@ -188,7 +195,7 @@ jobs: # with: # name: test-results # path: coverage - ## Upload the test results artifact + ## Upload the documentation site - name: Archive production artifacts uses: actions/upload-artifact@v4 with: @@ -196,12 +203,14 @@ jobs: path: dist/documentation-site/ include-hidden-files: true deploy-doc-site: - name: Deploy documentation site to dev server + name: Deploy documentation site and downloads to dev server ## Only do this if the repo is NCIOCPL if: startsWith(github.repository, 'NCIOCPL') ## This job depends on build completing needs: build runs-on: ubuntu-latest + permissions: + contents: read steps: - name: Download built site uses: actions/download-artifact@v4 @@ -247,6 +256,24 @@ jobs: local-path: ${{ format('{0}.zip', env.BUILD_NAME) }} ## Note this action automatically prepends the cpcode to the path. destination-path: ${{ format('/{0}.zip', env.BUILD_NAME) }} + # The CDN artifact is named with the version from package-lock so we need to find that to upload it. + - name: Get CDN artifact name + id: cdn-name + run: | + FILE=$(ls documentation-site/downloads/ncids-v*.zip 2>/dev/null | head -n 1) + FILENAME=$(basename "$FILE") + echo "filename=$FILENAME" >> "$GITHUB_OUTPUT" + - name: Upload CDN artifact to netstorage + uses: nciocpl/netstorage-upload-action@v1.0.0 + with: + hostname: ${{ secrets.ns_hostname }} + cp-code: ${{ secrets.ns_cdn_cpcode }} + key-name: ${{ secrets.ns_keyname }} + key: ${{ secrets.ns_key }} + index-zip: true + local-path: ${{ format('documentation-site/downloads/{0}', steps.cdn-name.outputs.filename) }} + ## Note this action automatically prepends the cpcode to the path. + destination-path: ${{ format('/{0}.zip', env.BUILD_NAME, steps.cdn-name.outputs.filename) }} - name: Clear Site Cache uses: nciocpl/akamai-purge-action@v1.0.2 with: @@ -255,4 +282,4 @@ jobs: client-secret: ${{ secrets.eg_client_secret }} access-token: ${{ secrets.eg_access_token }} type: "cpcodes" - ref: ${{ format('{0},{1}', secrets.ns_cpcode, secrets.prop_cpcode) }} + ref: ${{ format('{0},{1},{2}', secrets.ns_cpcode, secrets.ns_cdn_cpcode, secrets.prop_cpcode) }} diff --git a/.gitignore b/.gitignore index f0eb09c9c..a47e4bcfd 100644 --- a/.gitignore +++ b/.gitignore @@ -109,3 +109,5 @@ dist # ide .idea/* .vscode/settings.json + +cdn/ diff --git a/docs/content/get-started/developers.mdx b/docs/content/get-started/developers.mdx index 70df10c22..f6cda98ad 100644 --- a/docs/content/get-started/developers.mdx +++ b/docs/content/get-started/developers.mdx @@ -9,21 +9,21 @@ meta_description: | # Getting Started for Developers -To get started using the NCI Design System (NCIDS), developers will go through three phases: installing, compiling, and customizing the code. This page provides a step-by-step guide, taking developers through the process of each of these phases. Please reference our [contact information](/about#contact-us) if additional support is needed. +Get started using the NCI Design System (NCIDS) by installing Node and npm (recommended), using a Content Delivery Network (CDN), or through a direct download of the NCIDS files. -- [Step 1: Install](#step-1-install-node-and-npm) -- [Step 2: Compile and Import](#step-2-compile-and-import) -- [Step 3: Customize](#step-3-customize) +This page provides a step-by-step guide on how to install, compile, and customize your code using Node and npm. Options to use the CDN or a direct download of the NCIDS for your project are also provided. Please reference our [contact information](/about#contact-us) if additional support is needed. -## Step 1: Install Node and npm +## Node and npm -NCIDS distributes our source code through a node package manager (npm), which uses a flavor of JavaScript called Node.js. The best way to add NCIDS to your project is with npm via a Terminal window. (Check out some tips for using Terminal on a [Mac](https://support.apple.com/guide/terminal/open-or-quit-terminal-apd5265185d-f365-44cb-8b09-71a064a42125/mac) or [Windows](https://www.microsoft.com/en-us/p/windows-terminal/9n0dx20hk701?rtc=1&activetab=pivot:overviewtab).) +### Step 1: Install Node and npm + +NCIDS distributes our source code through a node package manager (npm), which uses a flavor of JavaScript called Node.js. We recommend using the NCIDS via npm because it provides more flexibility through its modular approach. The best way to add NCIDS to your project is with npm via a Terminal window. (Check out some tips for using Terminal on a [Mac](https://support.apple.com/guide/terminal/open-or-quit-terminal-apd5265185d-f365-44cb-8b09-71a064a42125/mac) or [Windows](https://www.microsoft.com/en-us/p/windows-terminal/9n0dx20hk701?rtc=1&activetab=pivot:overviewtab).) Installing the Design System with Node and npm not only allows you to install all the code the Design System needs to compile with just a couple commands, but will version any installed packages, like NCIDS, as well — meaning your project code is tied to a specific version of the Design System. Confirming what version you’re using and updating to a newer (or older) version is straightforward. To download fonts, refer to the [Typography](/foundations/typography) page. -### Step 1.1: Install Node +#### Step 1.1: Install Node 1. Ensure that you have Node.js installed, preferably Node 18, to meet the required runtime environment. @@ -31,7 +31,7 @@ To download fonts, refer to the [Typography](/foundations/typography) page. If you don’t have Node, we recommend installing it through a node version manager such as [Node Version Manager](https://github.com/nvm-sh/nvm) on a Mac or Linux machine, or [nvm-windows](https://github.com/coreybutler/nvm-windows) on a Windows machine. It can also be installed directly from [Node.js](https://nodejs.org/en/download/). -### Step 1.2: Authenticating to the NCIDS npm registry +#### Step 1.2: Authenticating to the NCIDS npm registry NCIDS utilizes GitHub’s npm registry to host its packages. To access and download these packages, you need to be authenticated with a valid access token. @@ -66,7 +66,7 @@ NCIDS utilizes GitHub’s npm registry to host its packages. To access and downl For more details, see [authenticating with a personal access token](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-npm-registry#authenticating-with-a-personal-access-token). -### Step 1.3: Initialize Your Project in Node +#### Step 1.3: Initialize Your Project in Node 1. Once you have Node and npm installed, go to the root of your project directory in Terminal. The root is the topmost directory associated with your project, the directory that includes all your project files and directories. In Terminal, the root will read as follows: @@ -88,7 +88,7 @@ In order to download the NCIDS, you will have to set up the @nciocpl organizatio @nciocpl:registry=https://npm.pkg.github.com ``` -### Step 1.4: Install NCIDS +#### Step 1.4: Install NCIDS
+ {snippet}
+
+ );
+};
+
+### NCIDS Minimal
+
+For a minimal configuration of the NCIDS, use the tags below:
+
+
+ {snippet}
+
+ );
+};
+
+Download here: