This document contains minimal usage examples for the reusable workflows in this repository.
Example workflow:
on:
push:
branches: [main]
jobs:
provision:
uses: equinor/ops-actions/.github/workflows/[email protected]
with:
environment: development
secrets:
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
ENCRYPTION_PASSWORD: ${{ secrets.ENCRYPTION_PASSWORD }}
Prerequisites:
- Configure Azure credentials
- Configure Terraform backend
- Configure GitHub secret
ENCRYPTION_PASSWORD
with a randomly generated password (used to encrypt the uploaded artifact, as it may contain sensitive infrastructure configuration)
Supported Terraform providers:
Name | Source | Version |
---|---|---|
Azure | hashicorp/azurerm |
>= v3.20.0 |
AzAPI | azure/azapi |
>= v1.3.0 |
Example workflow:
on:
push:
branches: [main]
jobs:
build:
uses: equinor/ops-actions/.github/workflows/[email protected]
with:
registry_name: crexampledev
secrets:
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
deploy:
needs: build
uses: equinor/ops-actions/.github/workflows/[email protected]
with:
environment: development
image: ${{ needs.build.outputs.image }}
app_name: app-example-dev
secrets:
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
Prerequisites:
Example workflow:
on:
push:
branches: [main]
jobs:
build:
uses: equinor/ops-actions/.github/workflows/[email protected]
with:
pip_install_target: .python_packages/lib/site-packages # Required
deploy:
needs: build
uses: equinor/ops-actions/.github/workflows/[email protected]
with:
environment: development
artifact_name: ${{ needs.build.outputs.artifact_name }}
app_name: func-example-dev
secrets:
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
Prerequisites:
Example workflow:
on:
push:
branches: [main]
jobs:
build:
uses: equinor/ops-actions/.github/workflows/[email protected]
with:
venv_path: antenv # Required
pip_install_target: .python_packages/lib/site-packages # Required
deploy:
needs: build
uses: equinor/ops-actions/.github/workflows/[email protected]
with:
environment: development
artifact_name: ${{ needs.build.outputs.artifact_name }}
app_name: app-example-dev
secrets:
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
Prerequisites:
Example workflow:
on:
push:
branches: [main]
jobs:
build:
uses: equinor/ops-actions/.github/workflows/[email protected]
with:
project: .
deploy:
needs: build
uses: equinor/ops-actions/.github/workflows/[email protected]
with:
environment: development
artifact_name: ${{ needs.build.outputs.artifact_name }}
app_name: app-example-dev
secrets:
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
Prerequisites:
Example workflow:
on:
push:
branches: [main]
paths:
- docs/**
- mkdocs.yml
jobs:
build:
uses: equinor/ops-actions/.github/workflows/[email protected]
deploy:
needs: build
uses: equinor/ops-actions/.github/workflows/[email protected]
with:
artifact_name: ${{ needs.build.outputs.artifact_name }}