new: docker workflow action
Some checks failed
Build docker image / build (push) Failing after 2m45s
Some checks failed
Build docker image / build (push) Failing after 2m45s
Signed-off-by: ngn <ngn@ngn.tf>
This commit is contained in:
parent
c841695ed4
commit
ce78bf803b
28
.gitea/workflows/docker.yml
Normal file
28
.gitea/workflows/docker.yml
Normal file
@ -0,0 +1,28 @@
|
||||
name: Build docker image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ["main"]
|
||||
|
||||
env:
|
||||
REGISTRY: git.matterlinux.xyz
|
||||
IMAGE: ${{gitea.repository}}/doc
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: "https://github.com/actions/checkout@v4"
|
||||
|
||||
- name: Login to container repo
|
||||
uses: "https://github.com/docker/login-action@v1"
|
||||
with:
|
||||
registry: ${{env.REGISTRY}}
|
||||
username: ${{gitea.actor}}
|
||||
password: ${{secrets.PACKAGES_TOKEN}}
|
||||
|
||||
- name: Build image
|
||||
run: |
|
||||
docker build --tag ${{env.REGISTRY}}/${{env.IMAGE}}:latest .
|
||||
docker push ${{env.REGISTRY}}/${{env.IMAGE}}:latest
|
10
Dockerfile
10
Dockerfile
@ -2,16 +2,22 @@ FROM golang:1.23.2
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY *.go ./
|
||||
RUN useradd runner -r -u 1001 -d /app
|
||||
RUN chown -R runner:runner /app
|
||||
USER runner
|
||||
|
||||
COPY *.mod ./
|
||||
COPY *.sum ./
|
||||
|
||||
RUN go mod download
|
||||
|
||||
COPY *.go ./
|
||||
COPY lib ./lib
|
||||
COPY log ./log
|
||||
COPY public ./public
|
||||
COPY routes ./routes
|
||||
COPY templates ./templates
|
||||
|
||||
RUN go build .
|
||||
RUN make
|
||||
|
||||
ENTRYPOINT ["/app/tracker"]
|
||||
|
Loading…
x
Reference in New Issue
Block a user