Skip to content

Commit 34577d5

Browse files
committed
add web
1 parent 5eb6bc5 commit 34577d5

4 files changed

Lines changed: 28 additions & 24 deletions

File tree

.github/workflows/mail.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ jobs:
1212
with:
1313
go-version: 1.13
1414
id: go
15-
- name: Set up Node
16-
uses: actions/setup-node@v1
17-
with:
18-
node-version: '10.x'
1915

2016
- name: Check out code into the Go module directory
2117
uses: actions/checkout@v1
@@ -28,11 +24,14 @@ jobs:
2824
run: |
2925
cd api
3026
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ../app main.go
27+
3128
- name: Build the Docker image
3229
run: |
30+
cd api
3331
docker login --username=${{secrets.DOCKER_USERNAME}} --password=${{secrets.DOCKER_PASSWORD}} registry.cn-shanghai.aliyuncs.com
3432
docker build . --file Dockerfile --tag registry.cn-shanghai.aliyuncs.com/fifsky/gostruct
3533
docker push registry.cn-shanghai.aliyuncs.com/fifsky/gostruct
34+
3635
- name: Publish to Aliyun
3736
uses: fifsky/ssh-action@master
3837
with:
@@ -45,5 +44,14 @@ jobs:
4544
docker rm gostruct
4645
docker rmi registry-vpc.cn-shanghai.aliyuncs.com/fifsky/gostruct:latest
4746
docker pull registry-vpc.cn-shanghai.aliyuncs.com/fifsky/gostruct
48-
docker run -d --name gostruct --restart always -p 80:80 -p 443:443 -v /home/wwwroot/:/home/wwwroot/ -v /root/.caddy:/root/.caddy registry-vpc.cn-shanghai.aliyuncs.com/fifsky/gostruct
49-
docker logs blog
47+
docker run -d --name gostruct --restart always --network fifsky --network-alias gostruct registry-vpc.cn-shanghai.aliyuncs.com/fifsky/gostruct
48+
49+
- name: Dingtalk message
50+
uses: fifsky/dingtalk-action@master
51+
with:
52+
url: ${{ secrets.DINGTALK_WEBHOOK}}
53+
type: markdown
54+
content: |
55+
## Github Action
56+
> genstruct deploy successful
57+
> ^_^

Dockerfile

Lines changed: 0 additions & 17 deletions
This file was deleted.

api/Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM alpine:latest
2+
RUN apk update && \
3+
apk add --no-cache ca-certificates \
4+
tzdata
5+
6+
WORKDIR /app
7+
8+
COPY ./app ./
9+
10+
ENV TZ=Asia/Shanghai
11+
EXPOSE 8989
12+
13+
ENTRYPOINT ["./app"]

api/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ func main() {
9090
w.Write(st)
9191
})
9292

93-
err = http.ListenAndServe(":8881", nil)
93+
err = http.ListenAndServe(":8989", nil)
9494

9595
if err != nil {
9696
log.Fatal("ListenAndServe", err)

0 commit comments

Comments
 (0)