Skip to content

Commit

Permalink
add web
Browse files Browse the repository at this point in the history
  • Loading branch information
fifsky committed Mar 18, 2020
1 parent 5eb6bc5 commit 34577d5
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 24 deletions.
20 changes: 14 additions & 6 deletions .github/workflows/mail.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ jobs:
with:
go-version: 1.13
id: go
- name: Set up Node
uses: actions/setup-node@v1
with:
node-version: '10.x'

- name: Check out code into the Go module directory
uses: actions/checkout@v1
Expand All @@ -28,11 +24,14 @@ jobs:
run: |
cd api
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ../app main.go
- name: Build the Docker image
run: |
cd api
docker login --username=${{secrets.DOCKER_USERNAME}} --password=${{secrets.DOCKER_PASSWORD}} registry.cn-shanghai.aliyuncs.com
docker build . --file Dockerfile --tag registry.cn-shanghai.aliyuncs.com/fifsky/gostruct
docker push registry.cn-shanghai.aliyuncs.com/fifsky/gostruct
- name: Publish to Aliyun
uses: fifsky/ssh-action@master
with:
Expand All @@ -45,5 +44,14 @@ jobs:
docker rm gostruct
docker rmi registry-vpc.cn-shanghai.aliyuncs.com/fifsky/gostruct:latest
docker pull registry-vpc.cn-shanghai.aliyuncs.com/fifsky/gostruct
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
docker logs blog
docker run -d --name gostruct --restart always --network fifsky --network-alias gostruct registry-vpc.cn-shanghai.aliyuncs.com/fifsky/gostruct
- name: Dingtalk message
uses: fifsky/dingtalk-action@master
with:
url: ${{ secrets.DINGTALK_WEBHOOK}}
type: markdown
content: |
## Github Action
> genstruct deploy successful
> ^_^
17 changes: 0 additions & 17 deletions Dockerfile

This file was deleted.

13 changes: 13 additions & 0 deletions api/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM alpine:latest
RUN apk update && \
apk add --no-cache ca-certificates \
tzdata

WORKDIR /app

COPY ./app ./

ENV TZ=Asia/Shanghai
EXPOSE 8989

ENTRYPOINT ["./app"]
2 changes: 1 addition & 1 deletion api/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func main() {
w.Write(st)
})

err = http.ListenAndServe(":8881", nil)
err = http.ListenAndServe(":8989", nil)

if err != nil {
log.Fatal("ListenAndServe", err)
Expand Down

0 comments on commit 34577d5

Please sign in to comment.