Skip to content

Commit

Permalink
Adds documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
nickschuch committed Oct 31, 2023
1 parent ff39448 commit a720898
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 1 deletion.
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,20 @@
# gh-workflows
# GitHub Actions Workflows

This repository contains GitHub Action workflows to make it easy to automate your development pipeline.

## Usage

Example use below, see documentation for more [details](#documentation) on each workflow.

```yaml
jobs:
my_job:
uses: skpr/gh-workflow/.github/workflows/workflow_file.yml@main
with:
input_a: abc
input_b: def
```
## Documentation
* [Preview Environment](/docs/preview.md) - Create preview environments as part of a pull request workflow.
76 changes: 76 additions & 0 deletions docs/preview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Preview Environment

The following document outlines our Github Workflows which faciliate a preview environment deployment pipeline.

## Required Secrets

The following are secrets which are provided by a Skpr platform team member.

* SKPR_PREVIEW_REGISTRY_URL
* SKPR_PREVIEW_REGISTRY_USERNAME
* SKPR_PREVIEW_REGISTRY_PASSWORD

## Examples

### Create Preview Environment

Creates a preview environment as part of a pull request workflow.

This workflow will:

* Package the application using the same approach as `skpr package`.
* Deploy the application onto Preview environment infrastructure.
* Execute post deploy commands after the preview environment is deployed.

```yaml
name: Create Preview Environment

on:
pull_request:
types: [ synchronize, opened, reopened, ready_for_review ]

concurrency:
group: preview-${{ github.head_ref }}
cancel-in-progress: true

jobs:
deploy:
uses: skpr/gh-workflows/.github/workflows/preview-create.yml@main
secrets:
skpr_preview_registry_url: ${{ secrets.SKPR_PREVIEW_REGISTRY_URL }}
skpr_preview_username: ${{ secrets.SKPR_PREVIEW_USERNAME }}
skpr_preview_password: ${{ secrets.SKPR_PREVIEW_PASSWORD }}
with:
ref: ${{ github.event.pull_request.head.ref }}
eks_cluster_name: NEEDS TO BE CONFIGURED
k8s_namespace: NEEDS TO BE CONFIGURED
domain: NEEDS TO BE CONFIGURED
post_deploy_command: drush deploy
```
### Delete Preview Environment
Deletes a preview environment when a pull request is closed or moved to a draft state.
```yaml
name: Delete Preview Environment

on:
pull_request:
types: [ closed, converted_to_draft ]

concurrency:
group: preview-${{ github.head_ref }}
cancel-in-progress: true

jobs:
deploy:
uses: skpr/gh-workflows/.github/workflows/preview-delete.yml@main
secrets:
skpr_preview_username: ${{ secrets.SKPR_PREVIEW_USERNAME }}
skpr_preview_password: ${{ secrets.SKPR_PREVIEW_PASSWORD }}
with:
ref: ${{ github.event.pull_request.head.ref }}
eks_cluster_name: NEEDS TO BE CONFIGURED
k8s_namespace: NEEDS TO BE CONFIGURED
```

0 comments on commit a720898

Please sign in to comment.