GithubHelp home page GithubHelp logo

apdlrcjafg19 / azure-devops-npm-action Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ponicode/azure-devops-npm-action

1.0 0.0 0.0 17 KB

Setup the .npmrc file for azure devops

Python 96.13% Dockerfile 3.87%

azure-devops-npm-action's Introduction

๐Ÿฆ„ Generate .npmrc file for Azure DevOps

This github action generates a .npmrc file for Azure DevOps

- uses: ponicode/azure-devops-npm-action@master
  with:
    organisation: "Ponicode"
    project: "my_project"
    registry: "my_registry"
    user: "unicorn"
    password: ${{ secrets.AZURE_TOKEN }}
    email: "[email protected]"
    scope: "ponicode"

How to setup (You must follow steps 1 and 2 to make the action work)

Step 1: Create a yaml workflow file in your project

Go to the root of your project, and create the path to your workflow file. For example

mkdir -p .github/workflows

Here is an example of what to put in your .github/workflows/publish-npm.yml file to trigger the action.

name: Publish on Azure NPM registry
on:
    push:
        branches: [master]
jobs:
    build:
        runs-on: ubuntu-latest
        steps:
        - uses: actions/checkout@v2
        - uses: ponicode/azure-devops-npm-action@master
          with:
              organisation: ponicode_org
              project: my_project
              registry: my_npm_registry
              user: unicorn
              password: ${{ secrets.AZURE_TOKEN }}
              email: [email protected]
              scope: ponicode
        - run: cp `pwd`/.npmrc ~ # We need the .npmrc file in the $HOME directory
        - name: Install dependencies
          run: npm install
        - name: Build
          run: npm run build
        - name: Publish to Azure
          run: npm publish

This yaml file build and publish your project everytime you push on master

Step 2: Add your Azure DevOps token to github secrets

Go to Azure DevOps to generate a new token. More imformation on the offical documentation. Once your token is correctly base64 encoded, you can had it to your github secrets by following these steps:

  • Open your project on Github
  • Click on Settings
  • Click on Secrets
  • Click on New Secret
  • Name: AZURE_TOKEN, Value: (Paste your token from Azure)

That's it! Once this is done, the action will be triggered on every push to master.

Ponicode Action inputs

Name Description Required
organisation Your Azure organisation true
project Your Azure project false
registry Your Azure registry true
user Your Azure user true
password Your Azure password true
email Your Azure email true
encode_password Encode the given password to base64 (default: false) false
scope Your Azure scope false

Contact us

We would love to hear your feedback! Tell us what you loved and what you want us to improve about this action at [email protected], or feel free to open a Github Issue.
We also have a Slack community channel, where people can ask for help if they encounter problems with our products and where we keep you informed about our latest releases.
If you want to know more about Ponicode and the different services we propose, check out our website www.ponicode.com!

Ponicode Logo

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.