Skip to content

Commit

Permalink
Creating actions
Browse files Browse the repository at this point in the history
  • Loading branch information
shawakash committed Sep 26, 2023
1 parent cce9476 commit bd145a5
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 1 deletion.
29 changes: 29 additions & 0 deletions .github/workflows/prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Prod

on:
push:
paths:
- 'apps/server/**'
- 'packages/database/**'
- 'packages/trpc/**'
- 'packages/types/**'
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: SSH and deploy
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
run: |
echo "$SSH_PRIVATE_KEY" > keyfile
chmod 600 keyfile
mkdir -p ~/.ssh
cp known_hosts ~/.ssh/known_hosts
ssh -t -i keyfile [email protected] "sudo pm2 start dev.sh --name dev"
10 changes: 10 additions & 0 deletions dev.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

# pulling the code
git pull origin main

# Stop and remove the Docker Compose containers and volumes
sudo docker-compose down --volumes

# Start the Docker Compose services
sudo docker-compose up
3 changes: 3 additions & 0 deletions known_hosts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ec2-34-232-78-97.compute-1.amazonaws.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCTjHW19x9+5UZ7yxBXAIFpzn3q81/FYcR4PRp9nGHApOV6jBoilCFaQdrR4Wn9Qq94g1uTH08fbim7ItZvxxO4SXhHiMnqFKTF7GqkbdQ0VeZyCUtATLtAzeCgzEmHS3graDz6xb4ETmYW7Z457qBEJihwndvclJ698o/uIfUJ/HXcmzehSxZTc1+0BQR4Bd7/8sR9pRzrFGLyiJxUwIw9XE1yI2JXMgJOaolqOSfq3S10Xp1Z84CzwAIEqk6rkO8P8WycDmJ8IjZCV3iVyZFmrErxePhoCpNLAcOcm8IqWOJrREPkQXh/PcT+bEWcGFitdcEXTsxvwWs8rU5J+5UaPYmyaw3YVqMlwS2TMrnexnRy/L5kloNnRffVbgtMwc42MI6zaHqUHYFqBCTWEhm5XlGmfYnRZWukTub6aN2FOyKOgh0VwN3RJIwJyZNQx+3FkxQVgtFx3exby+It71a7OBvGkRyksDkBot59dAc0rFVXSeBwb0UK0HqqUDY9fws=
ec2-34-232-78-97.compute-1.amazonaws.com ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBJg3KgeynBanvxFdtvsqIyv24sQaddXZfoybRzc2LVxiajRaHH19vmUndC3/lausIW2S1Yzph5PJxWesbLBwN4A=
ec2-34-232-78-97.compute-1.amazonaws.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAuEhEoyHKfc9qw7XCWouD8LL1oScdabf7rEoIh0/QRU
2 changes: 1 addition & 1 deletion packages/trpc/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const appRouter = router({
.mutation(async ({ ctx, input }) => {
const { TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN, TWILIO_PHONE_NUMBER } = ctx;
const { to, message, prevMessagesId } = input;
console.log(TWILIO_ACCOUNT_SID)
console.log(TWILIO_ACCOUNT_SID, 'TWILIO_ACCOUNT_SID')
const client = twilio(TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN);
// Use the Twilio client to send a message
const responseContent = message;
Expand Down

0 comments on commit bd145a5

Please sign in to comment.