diff --git a/.github/workflows/css-dev-docker.yml b/.github/workflows/css-dev-docker.yml new file mode 100644 index 0000000..e1eaf92 --- /dev/null +++ b/.github/workflows/css-dev-docker.yml @@ -0,0 +1,27 @@ +name: Dev-to-docker + +on: + workflow_dispatch: + +env: + IMAGE_NAME: watchyourlan + TAGS: dev-css + + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Build and Push Docker Image to docker.io + uses: mr-smithers-excellent/docker-build-push@v5 + with: + image: ${{ secrets.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }} + tags: ${{ env.TAGS }} + registry: docker.io + dockerfile: Dockerfile.css + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} \ No newline at end of file diff --git a/Dockerfile.css b/Dockerfile.css index 3f6b128..a8cccd5 100644 --- a/Dockerfile.css +++ b/Dockerfile.css @@ -1,11 +1,9 @@ FROM golang:bullseye AS builder +RUN cd / && git clone https://github.com/twbs/icons.git +RUN cd / && git clone https://github.com/thomaspark/bootswatch.git + COPY . /src - -RUN apt update && apt install -y npm -RUN cd / && npm i bootswatch > /dev/null 2>&1 \ - && npm i bootstrap-icons > /dev/null 2>&1 - RUN cd /src/cmd/WatchYourLAN/ && CGO_ENABLED=0 go build -o /WatchYourLAN . @@ -14,10 +12,13 @@ FROM alpine WORKDIR /app RUN apk add --no-cache tzdata arp-scan \ - && mkdir /data + && mkdir /data \ + && mkdir -p /app/css/bootswatch/dist \ + && mkdir -p /app/css/bootstrap-icons/font COPY --from=builder /WatchYourLAN /app/ -COPY --from=builder /node_modules /app/ +COPY --from=builder /icons/font /app/css/bootstrap-icons/font +COPY --from=builder /bootswatch/dist /app/css/bootswatch/dist ENTRYPOINT ["./WatchYourLAN"] -CMD ["-b", "/app/node_modules"] \ No newline at end of file +CMD ["-b", "/app/css"] \ No newline at end of file diff --git a/Makefile b/Makefile index 1cb6259..2699204 100644 --- a/Makefile +++ b/Makefile @@ -29,7 +29,7 @@ check: fmt lint go-build: cd cmd/WatchYourLAN/ && \ - go build . + CGO_ENABLED=0 go build -o ../../tmp/WatchYourLAN . docker-build: docker build -t $(DUSER)/$(DNAME) . diff --git a/cmd/WatchYourLAN/main.go b/cmd/WatchYourLAN/main.go index caf0bf9..a07fa87 100644 --- a/cmd/WatchYourLAN/main.go +++ b/cmd/WatchYourLAN/main.go @@ -11,8 +11,6 @@ const configPath = "/data/config" const bootPath = "" -// const bootPath = "/data/node_modules" - func main() { confPtr := flag.String("c", configPath, "Path to config file") bootPtr := flag.String("b", bootPath, "Path to local Bootswatch")