Resumen de ejemplo
This article uses an example workflow to demonstrate some of the main CI features of GitHub Actions. Cuando se activa este flujo de trabajo, este ejecuta automáticamente un script que verifica si el sitio de GitHub Docs tiene enlaces rotos.
The following diagram shows a high level view of the workflow's steps and how they run within the job:
Características utilizadas en este ejemplo
The example workflow demonstrates the following capabilities of GitHub Actions:
Característica | Implementación |
---|---|
Triggering a workflow to run automatically: | push |
Triggering a workflow to run automatically: | pull_request |
Manually running a workflow from the UI: | workflow_dispatch |
Setting permissions for the token: | permissions |
Controlling how many workflow runs or jobs can run at the same time: | concurrency |
Ejecutar el job en ejecutores diferentes, dependiendo del repositorio: | runs-on |
Cloning your repository to the runner: | actions/checkout |
Installing node on the runner: | actions/setup-node |
Utilizar una acción de terceros: | trilom/file-changes-action |
Ejemplo de flujo de trabajo
The following workflow was created by the GitHub Docs Engineering team. To review the latest version of this file in the github/docs
repository, see link-check-all.yml
.
Note: Each line of this workflow is explained in the next section at "Understanding the example."
|
Cómo entender el ejemplo
The following table explains how each of these features are used when creating a GitHub Actions workflow.
Código | Explicación |
---|---|
|
The name of the workflow as it will appear in the "Actions" tab of the GitHub repository. |
|
La palabra clave |
|
Agrega el evento |
|
Agrega el evento |
|
Agrega el evento |
|
Modifica los permisos predeterminados que se otorgan al |
|
Crea un grupo de concurrencia para los eventos específicos y utiliza el operador |
|
Cancela cualquier job o flujo de trabajo concurrentes en el mismo grupo de concurrencia. |
|
Agrupa todos los jobs que se ejecutan en el archivo de flujo de trabajo. |
|
Define un job con la ID |
|
Configura el job para ejecutarse en un ejecutor hospedado en GitHub o en un ejecutor auto-hospedado, dependiendo del repositorio que ejecuta el flujo de trabajo. En este ejemplo, el job se ejecutará en un ejecutor auto-hospedado si se nombra al repositorio |
|
Agrupa a todos los pasos que se ejecutarán como parte del job |
|
La palabra clave |
|
Este paso utiliza la acción |
|
La palabra clave |
|
Utiliza la acción |
|
Lista el contenido de |
|
Este paso usa el comando |
|
Este paso también utiliza el comando |
Pasos siguientes
- To learn about GitHub Actions concepts, see "Understanding GitHub Actions."
- For more step-by-step guide for creating a basic workflow, see "Quickstart for GitHub Actions."
- If you're comfortable with the basics of GitHub Actions, you can learn about workflows and their features at "About workflows."