Skip to content
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

Deploy #12

Merged
merged 48 commits into from
Dec 18, 2024
Merged

Deploy #12

merged 48 commits into from
Dec 18, 2024

Conversation

source-Alexander-Rudenko
Copy link
Collaborator

No description provided.

- run:
sudo apt-get install libwebp-dev
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

На будущее - вместо setup-go можно использовать параметр contaner, чтобы использовать для джобы любой нужный контейнер с докерхаба

run: |
echo "GOROOT=$(go env GOROOT)" >> $GITHUB_ENV
echo "GOBIN=$(go env GOBIN)" >> $GITHUB_ENV
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Для golangci-lint есть официальный github action, но так тоже сойдет

with:
go-version: '1.23.1'
- name: Build
run: go build -v ./...
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Не совсем понятно, зачем билдить явно перед тестами

echo "Using Commit Hash: ${{ env.COMMIT_HASH }}"
cd back
echo "Pulling latest code from deploy branch..."
git pull origin deploy
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Чет костыльно. По идее надо пушить бинарники на машину, а не пуллить. Но, конечно, править поздновато

func (h *AuthHandlers) Login(w http.ResponseWriter, r *http.Request) {
_, ok := utils.GetSessionFromContext(r.Context())
if ok {
utils.WriteResponse(w, http.StatusForbidden, httpErrors.ErrUserAlreadyLoggedIn)
return
}

body, err := io.ReadAll(r.Body)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

У easyjson есть методы, которые прямо из io.Reader могут читать в структуру, лучше их использовать


# Прокси для фронтенда
location / {
proxy_pass http://frontend:8000;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

До сих пор поднимаете фронтенд-сервер?


clean:
rm -rf $(BIN_DIR)

coverage:
go test $(go list ./... | grep -vE '/mocks|/docs|/vendor|/api|_easyjson.go') -coverprofile=coverage.out -coverpkg=$(go list ./... | grep -vE '/mocks|/vendor|/api|/docs|_easyjson.go' | tr '\n' ,) && go tool cover -func=coverage.out | grep total
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Вынести бы в переменную исключаемые пакеты, а так норм

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Что-то не вижу в конфиге http2

@reddiridabl666 reddiridabl666 merged commit f03c0cf into main Dec 18, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants