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

Deploy the Application to Google Cloud Platform (GCP) Using GitHub Actions #7

Open
prasadhonrao opened this issue Sep 5, 2024 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed
Milestone

Comments

@prasadhonrao
Copy link
Owner

Description:
We need to automate the deployment of the MERN Bootcamp application to Google Cloud Platform (GCP) using GitHub Actions. This will streamline our deployment process and ensure that updates are deployed to GCP automatically whenever code is merged into the main branch.

Task:

  1. Set up GCP Resources:

    • Backend (API Server): Set up a Google App Engine or Google Cloud Run service for the backend API server.
    • Frontend (UI): Set up a Google Cloud Storage bucket for static website hosting, or deploy the frontend to Google App Engine or Google Cloud Run.
  2. Configure GitHub Actions:

    • Create a GitHub Actions workflow to deploy both the backend and frontend to GCP.
    • Use the official GitHub Actions for deploying to GCP:
    • The workflow should be triggered on the following events:
      • push to the main branch.
      • pull request merged into the main branch.
  3. Configure Secrets in GitHub:

    • Add the following secrets to the GitHub repository:
      • GCP_PROJECT_ID - The GCP project ID where your resources are located.
      • GCP_SA_KEY - Base64-encoded JSON key file for a GCP service account with permissions to deploy to App Engine, Cloud Run, or Cloud Storage.
      • GCP_APP_ENGINE_SERVICE (if applicable) - Name of the App Engine service for the backend.
      • GCS_BUCKET_NAME (if using Cloud Storage) - Name of the Cloud Storage bucket for the frontend.
  4. Workflow Steps:

    • Backend (API Server):
      • Build the backend API server.
      • Deploy the API server to Google App Engine or Cloud Run using the google-cloud-deploy GitHub Action.
    • Frontend (UI):
      • Build the frontend UI app (if applicable).
      • If deploying to Cloud Storage, sync the build output to the Cloud Storage bucket using the google-cloud-storage-deploy GitHub Action.
      • Alternatively, deploy the frontend to App Engine or Cloud Run.
  5. Verify Deployment:

    • Ensure both the backend and frontend are successfully deployed to GCP after a push to the main branch.

Acceptance Criteria:

  • A GitHub Actions workflow exists for automatic deployment to GCP.
  • The backend (API server) is deployed to Google App Engine or Cloud Run on every push or PR merge to main.
  • The frontend (UI) is deployed to Google Cloud Storage (or App Engine/Cloud Run) on every push or PR merge to main.
  • Secrets are securely configured and used in the workflow.
  • Deployment logs are visible in the GitHub Actions tab for verification.

References:

@prasadhonrao prasadhonrao added enhancement New feature or request help wanted Extra attention is needed labels Sep 5, 2024
@prasadhonrao prasadhonrao added this to the v2 milestone Sep 13, 2024
prasadhonrao pushed a commit that referenced this issue Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
Status: No status
Development

No branches or pull requests

1 participant