diff --git a/.github/workflows/main-build.yml b/.github/workflows/main-build.yml index 8571c8c..4d63756 100644 --- a/.github/workflows/main-build.yml +++ b/.github/workflows/main-build.yml @@ -1,4 +1,4 @@ -name: roadie standard commit build +name: build on: push: @@ -25,11 +25,9 @@ jobs: - name: 'Setup Node' uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 20 - name: 'Build Frontend Artefacts' run: yarn && NODE_OPTIONS=--openssl-legacy-provider yarn build - - name: 'Mirror Dist' - run: cp -r ./dist ./pkg/server/dist - name: 'Run Tests' run: go test -cover -coverprofile=coverage.txt ./... - name: 'Archive Coverage Results' @@ -67,11 +65,9 @@ jobs: - name: 'Setup Node' uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 20 - name: 'Build Frontend Artefacts' run: yarn && NODE_OPTIONS=--openssl-legacy-provider yarn build - - name: 'Mirror Dist' - run: cp -r ./dist ./pkg/server/dist - name: 'Matrix Binary Compilation' run: GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} go build -o dist/roadie.${{ matrix.arch }}-${{ matrix.os }} ./cmd/roadie - name: 'Archive Binary' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e4e1f49..67cdef4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: release build +name: release on: push: @@ -25,11 +25,9 @@ jobs: - name: 'Setup Node' uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 20 - name: 'Build Frontend Artefacts' run: yarn && NODE_OPTIONS=--openssl-legacy-provider yarn build - - name: 'Mirror Dist' - run: cp -r ./dist ./pkg/server/dist - name: 'Compile Binary' run: mkdir bin && GOOS=${{ matrix.os }} GOARCH=amd64 go build -o bin/roadie-${{ matrix.os }}-amd64 ./cmd/roadie - name: 'Archive Binary' diff --git a/Dockerfile b/Dockerfile index 92c4bde..c4add9b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,9 +8,8 @@ FROM golang:alpine AS be WORKDIR "/rd" COPY . . -COPY --from=fe ["/app/dist/", "dist/"] +COPY --from=fe ["/app/pkg/server/dist/", "pkg/server/dist/"] RUN apk add --no-cache git && \ - cp -r ./dist ./pkg/server/dist && \ go build ./cmd/roadie && \ mv roadie / diff --git a/Makefile b/Makefile index 999e3b6..ccea0aa 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,6 @@ binaries: ; $(info $(C) building all binaries) binary: GOARCH?=amd64 binary: GOOS?=linux binary: ; $(info $(C) building binary $(PROJECT).$(GOARCH)-$(GOOS)) - $V cp -r ./dist ./pkg/server/dist $V $(GO) build -o dist/$(PROJECT).$(GOARCH)-$(GOOS) ./cmd/$(PROJECT) $V if [ "$(GOOS)" = "windows" ]; then \ $V mv dist/$(PROJECT).$(GOARCH)-$(GOOS) dist/$(PROJECT).$(GOARCH)-$(GOOS).exe; \ @@ -24,7 +23,7 @@ build-fe: ; $(info $(C) building the frontend assets) $V yarn && NODE_OPTIONS=--openssl-legacy-provider yarn build clean: ; $(info $(C) cleaning assets and dist) - $V rm -rf dist pkg/server/dist + $V rm -rf pkg/server/dist coverage: ; $(info $(C) running coverage) $V $(GO) test -race -covermode=atomic -coverprofile=c.out ./... @@ -32,7 +31,7 @@ coverage: ; $(info $(C) running coverage) $V $(GO) tool cover -html=c.out -o cover.html # at this time, there's no watch enabled for the go binary -dev-be: bin-prep bin-dist install ; $(info $(C) building back-end for dev) +dev-be: install ; $(info $(C) building back-end for dev) $V CONFIG_FILE=$(CONFIG_FILE) $(PROJECT) # dev-fe is a watch task with built-in node server @@ -46,7 +45,6 @@ docker.push: $V docker push cloudcloud/roadie:latest install: build-fe ; $(info $(C) installing $(PROJECT)) - $V rm -rf ./pkg/server/dist && cp -r ./dist ./pkg/server/dist $V $(GO) build ./cmd/$(PROJECT)/ local: diff --git a/package.json b/package.json index a8832d2..5699011 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "sass": "1.75.0", "sass-loader": "14.2.1", "vue": "^3.4.23", - "vue-router": "4.3.1", + "vue-router": "4.3.2", "vuetify": "^3.5.16", "vuex": "4.1.0", "webpack": "5.91.0", @@ -22,7 +22,7 @@ "y18n": "5.0.8" }, "devDependencies": { - "@mdi/font": "7.4.47", + "@mdi/font": "^7.4.47", "@mdi/js": "7.4.47", "@vue/cli-plugin-babel": "5.0.8", "@vue/cli-service": "5.0.8", diff --git a/pkg/server/server.go b/pkg/server/server.go index 3859d4b..e0e6dfe 100644 --- a/pkg/server/server.go +++ b/pkg/server/server.go @@ -138,8 +138,8 @@ func index(c *gin.Context) { s := strings.Replace( string(f), - "", - "", + "[ROADIE_BASE_URL]", + c.MustGet("config").(types.Configer).GetHostname(), 1, ) diff --git a/public/index.html b/public/index.html index 99947df..686ce1c 100644 --- a/public/index.html +++ b/public/index.html @@ -7,7 +7,7 @@ roadie - +