Closed maxmwang closed 1 month ago
I'd strongly recommend using reusable workflows when you have multiple workflows which do practically the same thing:
cd.yaml
name: Deploy
on:
workflow_call:
inputs:
environment:
type: string
required: true
...
# All examples
env:
GKE_CLUSTER: main-cluster
GKE_ZONE: us-central1-c
VAR_TAG: ${{ format('tag-{0}', inputs.environment) }}
...
jobs:
deploy:
name: Build and Deploy
runs-on: ubuntu-latest-m
steps:
...
cd-prod.yaml
name: Deploy to Production
on:
workflow_dispatch:
push:
branches: ["main"]
paths: ["apps/*"]
jobs:
deploy:
uses: ./.github/workflows/cd.yaml
secrets: inherit
with:
environment: prod
...
Primarily building off @Chengming-Li great work on testCICD.
This PR introduces CICD workflows via Github Actions for:
cd-prod.yaml
. Manually triggered, must be reviewed.cd-stage.yaml
. Automatically triggered on push tomaster
(andgql
for now).cd-dev.yaml
. Manually triggered, does not need review.Manually triggered workflows use the workflow dispatch trigger. To trigger these, go into the "Actions" tab, select the correct action on the left panel, then click "Run workflow".
The development workflow also initiates a pod that cleans up the dev install after a certain amount of seconds, inputted from engineers when first running the dev workflow. There is no enforced cap, but please keep this number small.