-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ff39448
commit a720898
Showing
2 changed files
with
96 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` |