Skip to content

Commit

Permalink
web to local
Browse files Browse the repository at this point in the history
  • Loading branch information
fifsky committed Mar 18, 2020
1 parent f804e9d commit d87d4eb
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
23 changes: 19 additions & 4 deletions .github/workflows/mail.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,38 @@ jobs:
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

- name: Get dependencies for Golang
run: |
cd api
go get -v -t -d ./...
- name: Build the Golang
- name: Build Golang api
run: |
cd api
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o app main.go
- name: Build web
run: |
cd web
npm install && npm run build
- name: Build the Docker image
run: |
cd api
echo ${{secrets.ENVFILE}} > .env
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
cd ../web
docker build . --file Dockerfile --tag registry.cn-shanghai.aliyuncs.com/fifsky/gostruct-web
docker push registry.cn-shanghai.aliyuncs.com/fifsky/gostruct-web
- name: Publish to Aliyun
uses: fifsky/ssh-action@master
Expand All @@ -41,11 +54,13 @@ jobs:
key: ${{ secrets.PRIVATE_KEY}}
command: |
docker login --username=${{secrets.DOCKER_USERNAME}} --password=${{secrets.DOCKER_PASSWORD}} registry-vpc.cn-shanghai.aliyuncs.com
docker stop gostruct
docker rm gostruct
docker rmi registry-vpc.cn-shanghai.aliyuncs.com/fifsky/gostruct:latest
docker stop gostruct gostruct-web
docker rm gostruct gostruct-web
docker rmi registry-vpc.cn-shanghai.aliyuncs.com/fifsky/gostruct:latest registry-vpc.cn-shanghai.aliyuncs.com/fifsky/gostruct-web:latest
docker pull registry-vpc.cn-shanghai.aliyuncs.com/fifsky/gostruct
docker pull registry-vpc.cn-shanghai.aliyuncs.com/fifsky/gostruct-web
docker run -d --name gostruct --restart always --network fifsky --network-alias gostruct registry-vpc.cn-shanghai.aliyuncs.com/fifsky/gostruct
docker run -d --name gostruct-web --restart always --network fifsky --network-alias gostruct-web registry-vpc.cn-shanghai.aliyuncs.com/fifsky/gostruct-web
- name: Dingtalk message
uses: fifsky/dingtalk-action@master
Expand Down
3 changes: 3 additions & 0 deletions web/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM abiosoft/caddy:latest
COPY ./Caddyfile /etc/Caddyfile
COPY ./dist/ /usr/share/caddy/

0 comments on commit d87d4eb

Please sign in to comment.