Merge pull request 'feature/train_go' (#1) from feature/train_go into main
Some checks failed
Deploy to Server (Docker) / deploy (push) Failing after 6s
Some checks failed
Deploy to Server (Docker) / deploy (push) Failing after 6s
Reviewed-on: https://git.gocommunity.ru/walleri1/go_winter_work_2025/pulls/1
This commit is contained in:
commit
8a73b135c0
29
.gitea/workflows/build.yaml
Normal file
29
.gitea/workflows/build.yaml
Normal file
@ -0,0 +1,29 @@
|
||||
name: Deploy to Server (Docker)
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- train_go
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Build Docker image
|
||||
run: docker build -t registry.gocommunity.ru:5000/my-app-image .
|
||||
|
||||
- name: List Docker image
|
||||
run: docker images
|
||||
|
||||
- name: Login to registry hub.
|
||||
run: docker login -u podman -p PodMan25! registry.gocommunity.ru:5000
|
||||
|
||||
- name: Push Docker image to registry
|
||||
run: docker push registry.gocommunity.ru:5000/my-app-image:latest
|
||||
|
||||
- name: Push Docker image to registry
|
||||
run: echo "Happy New Year!!"
|
23
go/cmd/main.go
Normal file
23
go/cmd/main.go
Normal file
@ -0,0 +1,23 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
time "time"
|
||||
|
||||
cycle "train_golang/pkg"
|
||||
)
|
||||
|
||||
func add(a, b int) {
|
||||
fmt.Println("Sum = ", a+b)
|
||||
}
|
||||
|
||||
func sub(a, b int) {
|
||||
fmt.Println("Sub = ", a-b)
|
||||
}
|
||||
|
||||
func main() {
|
||||
go add(5, 6)
|
||||
go sub(7, 9)
|
||||
cycle.SimpleForCycle()
|
||||
time.Sleep(1 * time.Second)
|
||||
}
|
11
go/pkg/cycle.go
Normal file
11
go/pkg/cycle.go
Normal file
@ -0,0 +1,11 @@
|
||||
package cycle
|
||||
|
||||
import (
|
||||
fmt "fmt"
|
||||
)
|
||||
|
||||
func SimpleForCycle() {
|
||||
for i := 0; i < 100; i++ {
|
||||
fmt.Println("Iter: ", i)
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user