Skip to content

Commit

Permalink
clear logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Dima committed Nov 3, 2023
1 parent 93b293d commit f9cdd48
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 12 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Deploy to Server

on:
push:
branches:
- master

jobs:
deploy:
runs-on: ubuntu-latest

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

- name: Install SSH key
run: |
mkdir -p ~/.ssh
echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -H "$SERVER_IP" >> ~/.ssh/known_hosts
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
SERVER_IP: ${{ secrets.SERVER_IP }}

- name: SSH into the server and update the code
run: |
ssh $SERVER_USERNAME@$SERVER_IP 'cd /root/ytstalker && git pull'
env:
SERVER_USERNAME: ${{ secrets.SERVER_USERNAME }}
SERVER_IP: ${{ secrets.SERVER_IP }}
2 changes: 0 additions & 2 deletions backend/api/reactions_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package api

import (
"encoding/json"
"log"
"net/http"

"github.com/gorilla/mux"
Expand All @@ -15,7 +14,6 @@ type ReactionStats struct {
}

func (s *Server) WriteReaction(w http.ResponseWriter, r *http.Request) {
log.Println("write reaction!")

w.Header().Set("Content-Type", "application/json")
encoder := json.NewEncoder(w)
Expand Down
4 changes: 2 additions & 2 deletions backend/api/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package api
import (
"context"
"fmt"
"go-youtube-stalker-site/backend/conf"
"go-youtube-stalker-site/backend/youtube"
"ytstalker/backend/conf"
"ytstalker/backend/youtube"
"log"
"net/http"
"os"
Expand Down
5 changes: 1 addition & 4 deletions backend/api/video_hander.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package api
import (
"encoding/json"
"fmt"
"go-youtube-stalker-site/backend/youtube"
"ytstalker/backend/youtube"
"log"
"net/http"
"strconv"
Expand Down Expand Up @@ -61,8 +61,6 @@ func (s *Server) GetVideo(w http.ResponseWriter, r *http.Request) {

func (s *Server) GetRandom(w http.ResponseWriter, r *http.Request) {

log.Println("get random")

w.Header().Set("Content-Type", "application/json")
encoder := json.NewEncoder(w)

Expand Down Expand Up @@ -197,7 +195,6 @@ func (s *Server) TakeFirstUnseen(conn *sqlite.Conn, sc *SearchCriteria, visitor
return nil, fmt.Errorf("error preparing query: %w", err)
}
rows, err := stmt.Step()
log.Println(rows)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion backend/youtube/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"net/url"
"strings"

"go-youtube-stalker-site/backend/conf"
"ytstalker/backend/conf"
)

type YouTubeRequester struct {
Expand Down
2 changes: 1 addition & 1 deletion frontend/static/css/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ body {
background-color: white;
font-family: monospace;
font-size: 1.4em;
padding: 0.6em 1.5em;
padding: 0.5em 0.5em;
border-radius: 0 0 7px 7px;
}

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module go-youtube-stalker-site
module ytstalker

go 1.20

Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"os/signal"
"time"

"go-youtube-stalker-site/backend/api"
"ytstalker/backend/api"
)

func main() {
Expand Down

0 comments on commit f9cdd48

Please sign in to comment.