Actions are reusable units of code that simplify tasks in workflows. They allow you to reuse existing scripts or create your own. Actions are useful for tasks like:
- Checking out the repository
- Setting up programming environments
- Installing dependencies
- Always first step to clone repository.
- name: Checkout code
uses: actions/checkout@v4- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'- name: Build & Push Docker
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: user/app:latest