-
Notifications
You must be signed in to change notification settings - Fork 82
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
Pull Request - CI/CD Part 2 Pipeline to Sandbox- Digital Dreamers #101
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
@hash2004 Kindly review this and share any further feedback you may have! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super clean code! Good job. Please see the review. Thanks!
Dockerfile
Outdated
@@ -16,4 +16,4 @@ COPY ./app /code/app | |||
|
|||
ENV PYTHONPATH=/code/app | |||
|
|||
CMD ["fastapi", "dev", "app/main.py", "--host=0.0.0.0", "--port=8000"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are currently using port 8000 for our backend. Could you clarify why we are using port 8080 here? Other than that, good job! Super clean :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for pointing out the mistake. I initially thought that google cloud port 8000 was a default variable that could not be modified. Following the Google Cloud Run documentation, I set the port parameter by --port 8000
in gcloud run deploy
and reverted the Dockerfile to its previous state. The changes have passed the tests.
Summary
Th CI/CD pipeline created using a YAML configuration automates the process of building, testing, and deploying your application to Google Cloud Run, ensuring a streamlined and secure deployment process.
Changes
ci-cd.yml
(Location: .github/workflows/ci-cd.yml)requirements.txt
. ‘Fastapi’ changed to ‘fastapi[standard]'Testing
Setting Up GitHub Actions and Configuring GCP Cloud Run: GitHub Actions was activated for the code repository for the first time. As part of the setup, the Google Cloud Run API was enabled to allow deployment of the application. Additionally, a Google Cloud service account was created, and its JSON key was securely stored as a GitHub Secret (
GOOGLE_CREDENTIAL
) to authenticate the deployment process.Triggering the YAML file through GitHub Actions: The ‘ci-cd.yml’ file triggers the workflow for the pipeline with continuous integration and deployment. Each time a new pull request is made and closed on
staging
branch, continuous integration/deployment is triggered using GitHub actions.Results
The pipeline passes all the tests, and the repo can complete CI/CD process.
Notes
Screenshots