Skip to content

Commit

Permalink
updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
alxkp committed Dec 4, 2022
1 parent b53c6e8 commit 5b9223b
Showing 1 changed file with 72 additions and 2 deletions.
74 changes: 72 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

0 comments on commit 5b9223b

Please sign in to comment.