Skip to content

Commit

Permalink
Backstage/trial cloudsmith (#1752)
Browse files Browse the repository at this point in the history
* backstage: use Cloudsmith to install node modules

* chore: change to trial install

* chore: change to trial install

* backstage: correct typos in scripts

* backstage: use Cloudsmith on all CI workflows
  • Loading branch information
frshwtr authored Jul 23, 2024
1 parent 8c0db01 commit 63d82c8
Show file tree
Hide file tree
Showing 10 changed files with 93 additions and 12 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/build-websites.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,14 @@ jobs:
with:
node-version: 18.x
cache: 'npm'
- run: npm ci
- name: Configure Cloudsmith
env:
CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }}
run: |
npm config set registry=https://npm.packages.ft.com/financial-times-internal-releases/
npm config set //npm.packages.ft.com/financial-times-internal-releases/:_authToken=${CLOUDSMITH_API_KEY}
- name: Install node modules
run: npm ci
- run: bash ./scripts/build-website.bash
- run: touch ./origami.ft.com/.nojekyll
- name: deploy 🚀
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/check-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ jobs:
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- run: npm ci
- name: Configure Cloudsmith
env:
CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }}
run: |
npm config set registry=https://npm.packages.ft.com/financial-times-internal-releases/
npm config set //npm.packages.ft.com/financial-times-internal-releases/:_authToken=${CLOUDSMITH_API_KEY}
- name: Install node modules
run: npm ci
- run: npm run regenerate
- run: ./scripts/check-for-changes.bash
9 changes: 8 additions & 1 deletion .github/workflows/check-privacy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,12 @@ jobs:
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- run: npm ci
- name: Configure Cloudsmith
env:
CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }}
run: |
npm config set registry=https://npm.packages.ft.com/financial-times-internal-releases/
npm config set //npm.packages.ft.com/financial-times-internal-releases/:_authToken=${CLOUDSMITH_API_KEY}
- name: Install node modules
run: npm ci
- run: node ./scripts/check-privacy.js
8 changes: 7 additions & 1 deletion .github/workflows/chromatic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ jobs:
uses: actions/checkout@v2
with:
fetch-depth: 0 # 👈 Required to retrieve git history
- name: Install dependencies
- name: Configure Cloudsmith
env:
CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }}
run: |
npm config set registry=https://npm.packages.ft.com/financial-times-internal-releases/
npm config set //npm.packages.ft.com/financial-times-internal-releases/:_authToken=${CLOUDSMITH_API_KEY}
- name: Install node modules
run: npm ci
# 👇 Adds Chromatic as a step in the workflow
- name: Publish to Chromatic
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/o2-chromatic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,13 @@ jobs:
uses: actions/checkout@v2
with:
fetch-depth: 0 # 👈 Required to retrieve git history
- name: Install dependencies
- name: Configure Cloudsmith
env:
CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }}
run: |
npm config set registry=https://npm.packages.ft.com/financial-times-internal-releases/
npm config set //npm.packages.ft.com/financial-times-internal-releases/:_authToken=${CLOUDSMITH_API_KEY}
- name: Install node modules
run: npm ci
# 👇 Adds Chromatic as a step in the workflow
- name: Publish Origami to Chromatic
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/o2-composition-chromatic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@ jobs:
uses: actions/checkout@v2
with:
fetch-depth: 0 # 👈 Required to retrieve git history
- name: Install dependencies
- name: Configure Cloudsmith
env:
CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }}
run: |
npm config set registry=https://npm.packages.ft.com/financial-times-internal-releases/
npm config set //npm.packages.ft.com/financial-times-internal-releases/:_authToken=${CLOUDSMITH_API_KEY}
- name: Install node modules
run: npm ci
# 👇 Adds Chromatic as a step in the workflow
- name: Publish Origami to Chromatic
Expand Down
18 changes: 16 additions & 2 deletions .github/workflows/percy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,14 @@ jobs:
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- run: npm ci
- name: Configure Cloudsmith
env:
CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }}
run: |
npm config set registry=https://npm.packages.ft.com/financial-times-internal-releases/
npm config set //npm.packages.ft.com/financial-times-internal-releases/:_authToken=${CLOUDSMITH_API_KEY}
- name: Install node modules
run: npm ci
- name: Find components affected by changes
id: percy-changes
run: |
Expand Down Expand Up @@ -90,7 +97,14 @@ jobs:
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- run: npm ci
- name: Configure Cloudsmith
env:
CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }}
run: |
npm config set registry=https://npm.packages.ft.com/financial-times-internal-releases/
npm config set //npm.packages.ft.com/financial-times-internal-releases/:_authToken=${CLOUDSMITH_API_KEY}
- name: Install node modules
run: npm ci
- name: Start Percy check
env:
PERCY_TOKEN: ${{ secrets[matrix.token_name] }}
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,14 @@ jobs:
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- run: npm ci
- name: Configure Cloudsmith
env:
CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }}
run: |
npm config set registry=https://npm.packages.ft.com/financial-times-internal-releases/
npm config set //npm.packages.ft.com/financial-times-internal-releases/:_authToken=${CLOUDSMITH_API_KEY}
- name: Install node modules
run: npm ci
- run: npm run -w ${{ matrix.component }} lint --if-present
- run: npm run -w ${{ matrix.component }} build --if-present
- run: npm run -w ${{ matrix.component }} test --if-present
Expand Down
18 changes: 16 additions & 2 deletions templates/percy-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,14 @@ jobs:
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- run: npm ci
- name: Configure Cloudsmith
env:
CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }}
run: |
npm config set registry=https://npm.packages.ft.com/financial-times-internal-releases/
npm config set //npm.packages.ft.com/financial-times-internal-releases/:_authToken=${CLOUDSMITH_API_KEY}
- name: Install node modules
run: npm ci
- name: Find components affected by changes
id: percy-changes
run: |
Expand Down Expand Up @@ -91,7 +98,14 @@ jobs:
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- run: npm ci
- name: Configure Cloudsmith
env:
CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }}
run: |
npm config set registry=https://npm.packages.ft.com/financial-times-internal-releases/
npm config set //npm.packages.ft.com/financial-times-internal-releases/:_authToken=${CLOUDSMITH_API_KEY}
- name: Install node modules
run: npm ci
- name: Start Percy check
env:
PERCY_TOKEN: ${{ secrets[matrix.token_name] }}
Expand Down
9 changes: 8 additions & 1 deletion templates/test-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,14 @@ jobs:
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- run: npm ci
- name: Configure Cloudsmith
env:
CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }}
run: |
npm config set registry=https://npm.packages.ft.com/financial-times-internal-releases/
npm config set //npm.packages.ft.com/financial-times-internal-releases/:_authToken=${CLOUDSMITH_API_KEY}
- name: Install node modules
run: npm ci
- run: npm run -w ${{ matrix.component }} lint --if-present
- run: npm run -w ${{ matrix.component }} build --if-present
- run: npm run -w ${{ matrix.component }} test --if-present
Expand Down

0 comments on commit 63d82c8

Please sign in to comment.