Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[core eng] modern CICD #723

Merged
merged 57 commits into from
Oct 9, 2024
Merged

[core eng] modern CICD #723

merged 57 commits into from
Oct 9, 2024

Conversation

maxmwang
Copy link
Contributor

@maxmwang maxmwang commented Sep 26, 2024

Primarily building off @Chengming-Li great work on testCICD.

This PR introduces CICD workflows via Github Actions for:

  • production in cd-prod.yaml. Manually triggered, must be reviewed.
  • staging in cd-stage.yaml. Automatically triggered on push to master (and gql for now).
  • development in 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.

@mathhulk
Copy link
Contributor

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
      ...

@maxmwang maxmwang merged commit 1927b4c into gql Oct 9, 2024
1 of 4 checks passed
@maxmwang maxmwang deleted the cicd branch October 9, 2024 02:26
@maxmwang maxmwang mentioned this pull request Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants