Merge branch 'dev'
This commit is contained in:
commit
85e1c6fe54
3 files changed
+51
-14
No files matched your search
@@ -29,9 +29,17 @@ jobs:
|
|||||||
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
|
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
|
||||||
dep ensure
|
dep ensure
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: go build -v .
|
run: |
|
||||||
- name: Release
|
ref=${{ github.ref }}
|
||||||
uses: softprops/action-gh-release@v1
|
go mod vendor
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
docker build . -t goadminteam/go-admin:${ref##*/}-${{ github.sha }}
|
||||||
|
docker tag goadminteam/go-admin:${ref##*/}-${{ github.sha }} goadminteam/go-admin:latest
|
||||||
|
- uses: Azure/docker-login@v1
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||||
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||||
|
- run: |
|
||||||
|
ref=${{ github.ref }}
|
||||||
|
docker push goadminteam/go-admin:${ref##*/}-${{ github.sha }}
|
||||||
|
docker push goadminteam/go-admin:latest
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
name: 'GitHub Actions Mirror'
|
||||||
|
|
||||||
|
on: [push, delete]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
mirror_to_gitee:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: 'Checkout'
|
||||||
|
uses: actions/checkout@v1
|
||||||
|
- name: 'Mirror to gitee'
|
||||||
|
uses: pixta-dev/repository-mirroring-action@v1
|
||||||
|
with:
|
||||||
|
target_repo_url:
|
||||||
|
git@gitee.com:go-admin-team/go-admin.git
|
||||||
|
ssh_private_key:
|
||||||
|
${{ secrets.GITEE_KEY }}
|
||||||
+21
-9
@@ -1,14 +1,26 @@
|
|||||||
FROM alpine
|
FROM golang:alpine as builder
|
||||||
|
|
||||||
|
MAINTAINER lwnmengjing
|
||||||
|
|
||||||
ENV GOPROXY https://goproxy.cn/
|
ENV GOPROXY https://goproxy.cn/
|
||||||
|
|
||||||
RUN apk update --no-cache
|
WORKDIR /go/release
|
||||||
RUN apk add --no-cache ca-certificates
|
#RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
|
||||||
RUN apk add --no-cache tzdata
|
RUN apk update && apk add tzdata
|
||||||
ENV TZ Asia/Shanghai
|
|
||||||
|
COPY go.mod ./go.mod
|
||||||
|
RUN go mod tidy
|
||||||
|
COPY . .
|
||||||
|
RUN pwd && ls
|
||||||
|
|
||||||
|
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-w -s" -a -installsuffix cgo -o go-admin .
|
||||||
|
|
||||||
|
FROM alpine
|
||||||
|
|
||||||
|
COPY --from=builder /go/release/go-admin /
|
||||||
|
|
||||||
|
COPY --from=builder /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
|
||||||
|
|
||||||
COPY ./main /main
|
|
||||||
COPY ./config/settings.prod.yml /config/settings.yml
|
|
||||||
EXPOSE 8000
|
EXPOSE 8000
|
||||||
RUN chmod +x /main
|
|
||||||
CMD ["/main","server","-c", "/config/settings.yml"]
|
CMD ["/go-admin","server","-c", "/config/settings.yml"]
|
||||||
Reference in new issue
Block a user