Repository Settings

Set secrets at the environment, repository or organization level

GitHub Repo Secrets

Reference the secret in the workflow YAML file:

Protect the ‘main’ and ‘Release’ branches

Branch Protection

Branch Protection Detail

Further Reading: About protected branches

Optionally, configure Environment protection rules

Environment Protection Rule

Optionally, protect tags

Protected tags

This prevents developers from creating and pushing their own tags.

GitHub Actions - CI/CD Pipeline

Each CI/CD pipeline is defined as a workflow with a corresponding YAML file in the (standard) .github/workflows folder:

GitHub Workflows Folder

The three workflow files aboce are essentially identical. They only differ in the type of trigger used and the target environment.

Development Trigger

on:
  pull_request:
    branches:
      - 'Release/*'

UAT/Staging Trigger

on:
  push:
    branches:
      - 'Release/*'

Production Trigger - Schedule

on:
  schedule: 
    - cron: '0/10 * * * *'

Production Trigger - Push

on:
  push:
    branches:
      - 'main'

Full Example

View previous workflow runs on the “Actions” tab

Workflow Runs

Environments

Access active environments from the project landing page:

Environments

The full deployment history for all environments:

Deployment History

Detail view for a particular deployment:

Deployment Detail