-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
1 changed file
with
72 additions
and
2 deletions.
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 |
---|---|---|
|
@@ -7,16 +7,86 @@ This repository contains shared CI/CD actions for all labs products, including t | |
- Django: build and publish | ||
- Docker Publish | ||
- Deployment: generate manifests and deploy to Kubernetes | ||
- Labs Application: consolidated build, publish, and deploy for standard React-Django labs applications | ||
|
||
## Usage | ||
To use shared actions, add the following to your workflow file: | ||
|
||
```yaml | ||
- uses: pennlabs/shared-actions/.github/workflows/[workflow-name].yaml@main | ||
- uses: pennlabs/shared-actions/.github/workflows/[workflow-name].yaml@[version tag] | ||
with: | ||
[parameter]: [value] | ||
``` | ||
Specifically, use each job as follows: | ||
### django-check | ||
```yaml | ||
name: "<JOB_NAME>" | ||
uses: pennlabs/shared-actions/.github/workflows/[email protected] | ||
with: | ||
projectName: <PROJECT_NAME> | ||
path: <PATH_TO_DJANGO_FOLDER>, root directory (.) by default> | ||
flake: <true/false>, whether to use flake linting> | ||
black: <true/false>, whether to run black on all python files> | ||
|
||
``` | ||
|
||
### react-check | ||
```yaml | ||
name: "<JOB_NAME>" | ||
uses: pennlabs/shared-actions/.github/workflows/[email protected] | ||
with: | ||
path: <PATH_TO_REACT_FOLDER>, root directory (.) by default> | ||
|
||
``` | ||
|
||
### docker-publish | ||
```yaml | ||
name: "<JOB_NAME>" | ||
uses: pennlabs/shared-actions/.github/workflows/[email protected] | ||
with: | ||
# Inputs | ||
imageName: "<PRODUCT_NAME_BACKEND>" | ||
githubRef: ${{ github.ref }} | ||
gitSha: ${{ github.sha }} | ||
|
||
# Optional inputs | ||
|
||
# Path to the docker context | ||
path: backend | ||
|
||
# Path to the dockerfile (relative to `path` variable) | ||
dockerfile: <DOCKERFILE_PATH> | ||
|
||
# If enabled, will cache_from the latest version of the docker image. | ||
cache: <true/false>, | ||
|
||
secrets: | ||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | ||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
needs: backend-check | ||
``` | ||
### deployment | ||
```yaml | ||
deploy: | ||
name: "Deploy" | ||
uses: pennlabs/shared-actions/.github/workflows/[email protected] | ||
|
||
with: | ||
githubRef: ${{ github.ref }} | ||
gitSha: ${{ github.sha }} | ||
|
||
secrets: | ||
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }} | ||
GH_AWS_ACCESS_KEY_ID: ${{ secrets.GH_AWS_ACCESS_KEY_ID }} | ||
GH_AWS_SECRET_ACCESS_KEY: ${{ secrets.GH_AWS_SECRET_ACCESS_KEY }} | ||
|
||
needs: | ||
- <BACKEND_PUBLISH_JOB_NAME> | ||
- <FRONTEND_PUBLISH_JOB_NAME> | ||
``` | ||
> NOTE: Information such as githubRefs, environment variables, and secrets must be passed into the shared action as | ||
inputs. |