Previously, actions written in YAML could only use scripts. Now, they can also reference other actions. This makes it easy to reduce duplication in your workflows.
For example, the following action uses 3 actions to setup buildx, log in to Docker, and publish an image. By combining these into a single action it provides a larger unit of reuse that you can put into the job of any workflow.
name: "Publish to Docker"
description: "Pushes built artifacts to Docker"
description: “Username for image registry”
description: “Password for image registry”
- uses: docker/setup-buildx-action@v1
- uses: docker/login-action@v1
- uses: docker/build-push-action@v2
Developers can then reference this action in all of their repositories as a single action:
- uses: actions/checkout@v2
- uses: my-org/publish-docker@v1
Learn more about action composition.
For questions, visit the GitHub Actions community