https://github.com/devops-dynamics/devops-dynamics-website
Source code for devops-dynamics.com
https://github.com/devops-dynamics/devops-dynamics-website
Last synced: 11 months ago
JSON representation
Source code for devops-dynamics.com
- Host: GitHub
- URL: https://github.com/devops-dynamics/devops-dynamics-website
- Owner: devops-dynamics
- Created: 2024-08-18T17:41:15.000Z (almost 2 years ago)
- Default Branch: staging
- Last Pushed: 2024-10-29T12:33:14.000Z (over 1 year ago)
- Last Synced: 2024-10-29T13:11:29.768Z (over 1 year ago)
- Language: TypeScript
- Homepage: https://devops-dynamics.com
- Size: 14.1 MB
- Stars: 3
- Watchers: 0
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Getting Started
To run this website in your local, your system must have Node.js LTS installed.
## 1. Clone the repo
Firstly, clone the github repo to your local system.
```
git clone https://github.com/devops-dynamics/devops-dynamics-website
cd devops-dynamics-website
```
## 2. Configure environment variables
Create a `.env.local` file in the root directory and add your environment variables.
| key | value | note |
| -------------------- | ------------------- | ------------------------------------------------- |
| DATABASE_URL | | Supbase Database URL |
| DIRECT_URL | | Supabse Direct URL |
| TOKEN_SECRET | | Token secret for authentication |
| BASE_URL | | For local development use "http://localhost:3000" |
| NEXT_PUBLIC_BASE_URL | | same as base url |
_You can follow the `.env.example` file._
## 3. Run the development server (with live reloading)
- ## To remove the dev container with volumes, run the following command
```
docker-compose -f docker-compose.local.yml --profile dev down --volumes --remove-orphans
```
- ## To start the application container run the following command
```
docker-compose -f docker-compose.local.yml --profile dev up
```
## 4. Build & run the production server (without live reloading)
- ## To remove the prod container with volumes, run the following command
```
docker-compose -f docker-compose.local.yml --profile build down --volumes --remove-orphans
```
- ## To build and start the container run the following command
```
docker-compose -f docker-compose.local.yml --profile build up
```
# Additional Information
## Configuring Supabase Environment Variables
- 1. First Login to your Supabase Account and Go to Dashboard
https://supabase.com/
- 2. Click on `New Project` and Choose Organization (if not already created , create one).
- 3. Fill the details (project name, database password & region) and click on `Create New Project`.
- 4. After finishing setting up the project, Click on `Connect`
- 5. In the `URI` tab, set the `Mode` to `Transaction` and copy the URI string. Paste it into your `.env.local` file & this will be your `DATABASE_URL`. Replace `[YOUR-PASSWORD]` with your database password.
- Append `?pgbouncer=true&connection_limit=1` to the end of the connection string.
- **Note:** The `connection_limit=1` parameter is only required if you are using Prisma from a serverless environment.
```
DATABASE_URL="postgres://[db-user].[project-ref]:[db-password]@aws-0-[aws-region].pooler.supabase.com:6543/[db-name]?pgbouncer=true&connection_limit=1"
```
- 6. Now set the `Mode` to `Session` and copy the URI string. Paste it into your .env.local file & This will be your `DIRECT_URL`. Replace `[YOUR-PASSWORD]` with your database password.
```
DIRECT_URL="postgres://[db-user].[project-ref]:[db-password]@aws-0-[aws-region].pooler.supabase.com:5432/[db-name]"
```
For more details visit : https://supabase.com/partners/integrations/prisma
# Using GitHub Actions for Testing Commits
This project uses GitHub Actions for continuous integration (CI) and to automate testing of commits. Here’s how you can use it:
## 1. Triggering the Workflow
### Automatic Trigger
The GitHub Actions workflow automatically triggers on every push to the `staging` branch. The build process will:
- Checkout the code from the repository.
- Set up Docker and build the Docker image.
- Run tests and ensure the build succeeds.
### Manual Trigger
You can manually trigger the workflow using the `workflow_dispatch` event, which is useful for testing specific commits or branches.
To manually trigger the workflow:
1. Go to the **Actions** tab in your GitHub repository.
2. Select the “Staging - Build Docker Image” workflow.
3. Click on the “Run workflow” button and specify the branch and commit ID to use in the image tag.
## 2. Reviewing the Workflow Status
After pushing your code, review the status of the GitHub Actions workflow:
- Go to the **Actions** tab in your GitHub repository.
- Select the relevant workflow run to see the details.
- Review the logs to ensure the build and tests have passed.
## 3. Debugging Failures
If the workflow fails:
- Review the logs in the GitHub Actions workflow for any error messages.
- Fix the issues in your code or configuration.
- Push the changes again, which will automatically re-trigger the workflow.