feat: update ci
Some checks failed
Build TGExporter / Build (push) Failing after 3m17s

This commit is contained in:
Rogee
2024-11-22 14:19:10 +08:00
parent 4a9695ffbf
commit c3d7a9ef15
2 changed files with 3 additions and 22 deletions

View File

@@ -34,12 +34,6 @@ jobs:
- name: Build final Docker image - name: Build final Docker image
run: | run: |
echo 'FROM docker.hub.ipao.vip/alpine:3.20' > Dockerfile
echo 'COPY config.yml /root/.exporter.yml' >> Dockerfile
echo 'COPY build/exporter /usr/local/bin/exporter' >> Dockerfile
echo 'WORKDIR /root' >> Dockerfile
echo 'ENTRYPOINT ["/usr/local/bin/exporter"]' >> Dockerfile
echo 'CMD [ "serve" ]' >> Dockerfile
docker login -u ${{ secrets.DOCKER_AF_USERNAME }} -p ${{ secrets.DOCKER_AF_PASSWORD }} docker-af.hub.ipao.vip docker login -u ${{ secrets.DOCKER_AF_USERNAME }} -p ${{ secrets.DOCKER_AF_PASSWORD }} docker-af.hub.ipao.vip
docker build --push -t docker-af.hub.ipao.vip/rogeecn/tg-exporter:latest . docker build --push -t docker-af.hub.ipao.vip/rogeecn/tg-exporter:latest .

View File

@@ -1,23 +1,10 @@
FROM docker.hub.ipao.vip/golang:1.22-alpine as builder
COPY . /app
WORKDIR /app
RUN go env -w GOPROXY=https://go.hub.ipao.vip,direct && \
go env -w GO111MODULE=on && \
cd /app && \
go mod tidy
RUN go build -o /app/exporter .
FROM docker.hub.ipao.vip/alpine:3.20 FROM docker.hub.ipao.vip/alpine:3.20
COPY --from=builder /app/exporter /usr/local/bin/exporter
COPY config.yml /root/.exporter.yml COPY config.yml /root/.exporter.yml
COPY build/exporter /usr/local/bin/exporter
WORKDIR /root WORKDIR /root
ENTRYPOINT ["/usr/local/bin/exporter"] ENTRYPOINT ["/usr/local/bin/exporter"]
CMD [ "serve" ]
CMD [ "serve" ]