

Use private NPM packages in your GitHub actions
source link: https://gist.github.com/nandorojo/46b3e46de12177b9ad7e4d454310de21
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

1 NPM_TOKEN
Add an NPM_TOKEN
secret on GitHub. Get your secret key from the NPM dashboard.
2 Add a step to your action
- name: Authenticate with private NPM package
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
A full example might look like:
name: Install cached packages
jobs:
install-with-cache:
name: Create new build on EAS
runs-on: ubuntu-latest
steps:
- name: Setup repo
uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Find yarn cache
id: yarn-cache-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Restore cache
uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Authenticate with private NPM package
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
- name: Install dependencies
run: yarn install --frozen-lockfile --check-files
Recommend
-
36
In the meantime of WWDC 2019 event, looking back to the web development area, NPM - the largest package registry on planet Earth - has passed the 1M mark, in terms of packages
-
4
How to use your private NPM packages with Docker on CI
-
10
Stuck with TravisCI? Looking for a worthy alternative to GitLab CI? Here’s a guide on how to create a full CI pipeline publishing GitHub Packages, Codecov reports, releasing to Maven Central and GitHub, including dynamic commitlogs.Gi...
-
8
Managing Node.js Docker images in GitHub Packages using GitHub Actions Liran Tal July 13, 2021 If...
-
15
How do you maintain and deploy multiple NPM modules? How do you make sure versions do not mismatch or that nothing breaks while upgrading dependencies? And how do you deploy multiple packages at the same time in one CLI command? Th...
-
10
epassaro Posted on Nov 19
-
8
Keep your npm and Yarn packages up to date117 viewsJan 27, 20225DislikeShareSave ...
-
14
Private NPM modules with GitHub packages Apr 4, 2022 • Tim VelettaTags: typescript
-
5
GitHub 全家桶:Actions 自动构建多架构 Docker 镜像并上传至 Packages (ghcr.io) 2021-11-24 Category:
-
8
Top 6 npm Packages for Component-Driven Prototyping with UXPin Merge
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK