Skip to content

Commit

Permalink
created shared-actions workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
alxkp committed Jan 29, 2023
1 parent edc183d commit 89e67d1
Showing 1 changed file with 109 additions and 0 deletions.
109 changes: 109 additions & 0 deletions .github/workflows/shared-build-deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# ========================================
# Note: If you make changes to this CI/CD, please include someone from DevOps in the list of reviewers for the PR.
# ========================================
name: Build and Deploy platform

on: push

jobs:
backend-check:
name: "Backend Check"
uses: pennlabs/shared-actions/.github/workflows/django-check.yaml@v0.1
with:
projectName: Platform
path: backend
flake: true
black: true
publish-backend:
uses: pennlabs/shared-actions/.github/workflows/docker-publish.yaml@v0.1
with:
# Inputs
imageName: "platform-backend"
githubRef: ${{ github.ref }}
gitSha: ${{ github.sha }}

# Optional inputs

# Path to the docker context
path: backend

# Path to the dockerfile (relative to the `path` variable
dockerfile: Dockerfile

# If enabled, will cache from the latest version of the docker imageName
cache: true

secrets:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}

needs: backend-check
publish-platform-dev:
uses: pennlabs/shared-actions/.github/workflows/docker-publish.yaml@v0.1
with:
# Inputs
imageName: "platform-dev"
githubRef: ${{ github.ref }}
gitSha: ${{ github.sha }}

# Optional inputs

# Path to the docker context
path: backend

# Path to the dockerfile (relative to the `path` variable
dockerfile: Dockerfile.dev

# If enabled, will cache from the latest version of the docker imageName
cache: true

secrets:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}

frontend-check:
name: "Frontend Check"
uses: pennlabs/shared-actions/.github/workflows/react-check.yaml@v0.1
with:
path: frontend

publish-frontend:
uses: pennlabs/shared-actions/.github/workflows/docker-publish.yaml@v0.1
with:
# Inputs
imageName: "platform-frontend"
githubRef: ${{ github.ref }}
gitSha: ${{ github.sha }}

# Path to the docker context
path: frontend

# Path to the dockerfile (relative to `path` variable)
dockerfile: Dockerfile

# If enabled, will cache_from the latest version of the docker image.
cache: true

secrets:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}

needs: frontend-check

deploy:
name: "Deploy"
uses: pennlabs/shared-actions/.github/workflows/deployment.yaml@v0.1

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:
- publish-backend
- publish-frontend
- publish-platform-dev

0 comments on commit 89e67d1

Please sign in to comment.