Repository containing multiple composite Github Actions(multiple declared in a YML which will evaluate to a single Github Action) for CI/CD pipelines.
Look for for the latest version available on the Releases page of this repository and update the actions @version.
Note
This template assumes Docker is already installed on the agent
# Login, build and push Docker image to DockerHub
- name: Build and Push Docker
uses: julanu/composite-actions/docker-build-push@latest
with:
registry_user: userID
registry_pwd: userToken
image_name: repo/image
tag: latest
context: .
dockerfile: ./Dockerfile
platforms: linux/arm64,linux/amd64
build_args: -e "token=value"Note
This template assumes the agent running it is already logged in to Azure and has the necessary permissions setup to deploy
# Add Helm repository, update repository, dry-run and install
- name: Helm Deploy to Kubernetes
uses: julanu/composite-actions/helm-deploy@latest
with:
chart_name: my-chart
registry_url: https://charts.helm.sh/stable
registry_name: bitnami
namespace: testing
chart_version: 4.1.14
helm_values_file: values.yaml # Initialize, Validate, Plan and Apply
- name: Terraform
uses: julanu/composite-actions/terraform-cli-deploy@latest
with:
initArguments: "-reconfigure"
additionalArguments: "-var-file=env/devel.tfvars -no-color"
workingDirectory: "infra/"
mainOnlyApply: "false" # Run apply on any branch run. Default runs apply only on main branch runNote
This will create a semver-like tag based on the latest one, differing for main and other branches
# Checkout and create a new version tag
- name: Create Version Tag
uses: julanu/composite-actions/create-version-tag@latest
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}- name: OpenTofu
uses: your-org/your-repo/opentofu-cli-deploy@latest
with:
initArguments: "-reconfigure"
additionalArguments: "-var-file=env/devel.tfvars -no-color"
workingDirectory: "infra/"
mainOnlyApply: "false" # Run apply on any branch. Default runs apply only on main branch