Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ci): fix CI auth (VIV-000) #1442

Merged
merged 1 commit into from
Nov 5, 2024
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
12 changes: 8 additions & 4 deletions .github/workflows/deploy-showcase-dev-s3.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: Build & Deploy Showcase (Dev)

permissions:
contents: read
packages: read

on:
pull_request:
types: [closed]
Expand All @@ -13,18 +17,16 @@ jobs:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID_B }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY_SECRET_B }}
AWS_DEFAULT_REGION: eu-west-2
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup NodeJS 14
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: 14

- run: printf "registry=https://npm.pkg.github.com/Vonage\n_authToken=\${GITHUB_TOKEN}\n//npm.pkg.github.com/:_authToken=\${GITHUB_TOKEN}\nalways-auth=true" > .npmrc
registry-url: https://npm.pkg.github.com

- name: Install yarn
run: npm install -g yarn
Expand All @@ -45,6 +47,8 @@ jobs:
- name: Install dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install --network-timeout 100000
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Build storybook
run: yarn storybook:build
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/deploy-showcase-pr-s3.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: Build & Deploy Showcase (PR)

permissions:
contents: read
packages: read

on:
pull_request:
types: [opened, synchronize, reopened]
Expand All @@ -11,7 +15,6 @@ jobs:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_VIVID_DEMO_PRS_ACCESS }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_VIVID_DEMO_PRS_SECRET }}
AWS_DEFAULT_REGION: us-east-1
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

steps:
- name: Add PR deploy URL comment
Expand All @@ -25,12 +28,11 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

- run: printf "registry=https://npm.pkg.github.com/Vonage\n_authToken=\${GITHUB_TOKEN}\n//npm.pkg.github.com/:_authToken=\${GITHUB_TOKEN}\nalways-auth=true" > .npmrc

- name: Setup NodeJS 14
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: 14
registry-url: https://npm.pkg.github.com

- name: Install yarn
run: npm install -g yarn
Expand All @@ -51,6 +53,8 @@ jobs:
- name: Install dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install --network-timeout 100000
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Build storybook
run: yarn storybook:build base-url=${{ github.event.number }}
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/post-merge-code-coverage.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: Master Code Coverage

permissions:
contents: read
packages: read

on:
push:
branches:
Expand All @@ -8,8 +12,6 @@ on:
jobs:
build-test-release:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

steps:
- name: Checkout
Expand All @@ -19,9 +21,10 @@ jobs:
ref: master

- name: Setup NodeJS 14
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: 14
registry-url: https://npm.pkg.github.com

- run: printf "registry=https://npm.pkg.github.com/Vonage\n_authToken=\${GITHUB_TOKEN}\n//npm.pkg.github.com/:_authToken=\${GITHUB_TOKEN}\nalways-auth=true" > .npmrc

Expand All @@ -44,6 +47,8 @@ jobs:
- name: Install packages
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install --network-timeout 100000
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Build components
run: yarn compile
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/pull-request-master.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: Master Pull Request

permissions:
contents: read
packages: read

on:
pull_request:
types:
Expand All @@ -21,21 +25,20 @@ jobs:
if: github.event.pull_request.draft == false
name: Build
runs-on: ubuntu-20.04
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- run: printf "registry=https://npm.pkg.github.com/Vonage\n//npm.pkg.github.com/:_authToken=\${GITHUB_TOKEN}\nalways-auth=true" > .npmrc
- uses: actions/setup-node@v2
- uses: actions/setup-node@v4
with:
node-version: 14
registry-url: https://npm.pkg.github.com
- uses: actions/cache@v2
with:
path: "**/node_modules"
key: ${{ hashFiles('yarn.lock') }}
- run: yarn install --frozen-lockfile --network-timeout 100000
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
- run: yarn lerna run build --stream --concurrency=15 --include-dependencies
- run: tar -zcf /tmp/vivid-env.tar.gz .
- uses: actions/upload-artifact@v4
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/release-prepare.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: Prepare Vivid for release

permissions:
contents: read
packages: read

on:
workflow_dispatch:
inputs:
Expand All @@ -21,18 +25,19 @@ jobs:
ref: master
token: ${{ secrets.VNG_VVD_PAT }}

- run: printf "registry=https://npm.pkg.github.com/Vonage\n_authToken=\${GITHUB_TOKEN}\n//npm.pkg.github.com/:_authToken=\${GITHUB_TOKEN}\nalways-auth=true" > .npmrc

- name: Use Node.js 14
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: 14
registry-url: https://npm.pkg.github.com

- name: Install yarn
run: npm install -g yarn

- name: Install dependencies
run: yarn install --network-timeout 100000
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

# Update to a new version
- name: Extract release version manually set
Expand Down
18 changes: 10 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: Release

permissions:
contents: read
packages: read

concurrency: ${{ github.workflow }}

on:
Expand All @@ -10,22 +14,20 @@ on:
jobs:
build:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.VNG_VVD_PAT }}

steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup NodeJS 14
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: 14

- name: Writing .npmrc
run: printf "registry=https://npm.pkg.github.com/Vonage\n//npm.pkg.github.com/:_authToken=\${GITHUB_TOKEN}\nalways-auth=true" > .npmrc
registry-url: https://npm.pkg.github.com

- name: Install dependencies
run: yarn install --network-timeout 100000
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

- run: yarn compile
- run: tar -zcf /tmp/vivid-env.tar.gz .
Expand Down Expand Up @@ -76,7 +78,7 @@ jobs:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_VIVID_DEMO_PROD_ACCESS }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_VIVID_DEMO_PROD_SECRET }}
AWS_DEFAULT_REGION: us-east-1
GITHUB_TOKEN: ${{ secrets.VNG_VVD_PAT }}

needs: publish
runs-on: ubuntu-latest
steps:
Expand All @@ -85,7 +87,7 @@ jobs:
with:
fetch-depth: 0
- name: Setup NodeJS 14
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: 14
- uses: actions/download-artifact@v4
Expand Down
Loading