# CI/CD with GitHub

One of the advantages of working with Widgets locally using the Modyo CLI ([modyo-cli] (/es/platform/channels/widgets.html #modyo -cli)) is that you can use tools to automate code review (CI) and make continuous delivery or continuous deployment (CD)

Catalog Widgets, as well as base templates to start a new project, provide "recipes" from GitHub Actions (opens new window) that you can use to run some of the most common CI/CD tasks quickly and easily.

These _"recipes" _ are in the README.md file located in the Widget's .github folder.

├── .Github/
│ ├── pr-labeler.yml
│ ├── release-drafter.yml
│ ── workflows/
│ ├── README.md <- * recetas * -> 
│ ├── pr-labeler.yml
│ ── release-draft.yml
├── src/
│ ├── App.vue

The recipes you can find are:

  • Build and publish to Modyo
  • Run ESLint, Stylelint, and Unit Tests on pull quests
  • Publish package on GitHub registry
  • Release draft
  • Release draft config
  • PR Labeler
  • PR Labeler config

TIP

Each of these is documented and explained in theREADME.md file

# Deploying a Widget with GitHub Actions

In order to load a Widget using GitHub Actions we need the "recipe" Build and Publish that makes use of the command [PUSH](/es/platform/channels/widgets.html #modyo -cli-push-name) of the Modyo CLI and for that we need a token that authorizes it.

To get a token we first need to create an API Access at the site's own account level. We'll go to **Settings (1) —> API access (2) —> New API access (3) —> Create (4) **.

1

After creating the access API we need to generate a token for the user who will load the Widget.

TIP

We recommend creating a new user that has permissions and the token to upload and publish Widgets from an CI/CD service.

Again at account level:

  1. Settings
  2. Team (we select or create a user)
  3. API access tab
  4. Select the Api access we created earlier
  5. Create Token

2

We now have the token we can use to configure our repository and so the GitHub action will have access to it.

2

Important

You should never share or publish the TOKEN or sensitive information in the repository! It is recommended to use environment variables, an .env file that is listed in the project's .gitignore locally, and make use of the secrets (opens new window) on GitHub.