Skip to content

Instantly share code, notes, and snippets.

View uurtech's full-sized avatar
✈️
Works

Ugur KAZDAL uurtech

✈️
Works
View GitHub Profile
const { spawn } = require('child_process');
module.exports.slackCommandHandler = async (event) => {
const { text } = event.body;
const deployWorkflow = spawn('curl', [
'-X', 'POST',
'-H', 'Authorization: token YOUR_GITHUB_TOKEN',
'-H', 'Accept: application/vnd.github.v3+json',
'https://api.github.com/repos/your_username/your_repo/actions/workflows/your_workflow_dispatch.yml/dispatches',
const express = require('express');
const { spawn } = require('child_process');
const bodyParser = require('body-parser');
const app = express();
const port = 3000;
app.use(bodyParser.urlencoded({ extended: true }));
app.post('/deploy', (req, res) => {
name: CI/CD Pipeline
on:
pull_request:
types: [opened, synchronize]
jobs:
deploy:
runs-on: ubuntu-latest
name: CI/CD Pipeline
on:
push:
branches:
- '*'
jobs:
deploy:
runs-on: ubuntu-latest
provider "aws" {
region = "us-east-1" # Update with your desired AWS region
}
# Create an S3 bucket for storing website files
resource "aws_s3_bucket" "website_bucket" {
bucket = "your-unique-bucket-name" # Update with your desired bucket name
website {
index_document = "index.html"
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
spec:
replicas: 3
selector:
matchLabels:
app: nginx
template:
apiVersion: v1
kind: Service
metadata:
name: nginx-service
spec:
selector:
app: nginx
ports:
- protocol: TCP
port: 80
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
spec:
replicas: 3
selector:
matchLabels:
app: nginx
template:
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
labels:
app: nginx
spec:
replicas: 3
selector:
matchLabels:
@uurtech
uurtech / gist:385fd56e01d1678067c1dabb40301e20
Created January 30, 2024 07:59
EKS, nginx with ingress controller
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
labels:
app: nginx
spec:
replicas: 3
selector:
matchLabels: