Skip to content

Commit cb89f89

Browse files
authored
Merge pull request #2 from IGoRFonin/docker-gh
add docker to ci
2 parents 0c83f3a + 0648953 commit cb89f89

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: test and release
1+
name: release
22

33
on: push
44

@@ -23,6 +23,16 @@ jobs:
2323
- name: Build ui
2424
run: make build-ui
2525

26+
- name: Publish to Registry
27+
if: startsWith(github.ref, 'refs/tags/')
28+
run: |
29+
docker build -t igorfonin/hoverfly .
30+
docker tag ${{ secrets.DOCKER_IMAGE_USER }}/hoverfly ghcr.io/${{ secrets.DOCKER_IMAGE_USER }}/hoverfly:${GITHUB_REF:10}
31+
docker tag ${{ secrets.DOCKER_IMAGE_USER }}/hoverfly ghcr.io/${{ secrets.DOCKER_IMAGE_USER }}/hoverfly:latest
32+
docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.GH_TOKEN }} ghcr.io
33+
docker push ghcr.io/${{ secrets.DOCKER_IMAGE_USER }}/hoverfly:${GITHUB_REF:10}
34+
docker push ghcr.io/${{ secrets.DOCKER_IMAGE_USER }}/hoverfly:latest
35+
2636
- name: Build
2737
run: GIT_TAG_NAME=master-$GITHUB_RUN_NUMBER make build
2838

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM golang:1.16.7 AS build-env
22
WORKDIR /usr/local/go/src/github.com/SpectoLabs/hoverfly
3-
COPY . /usr/local/go/src/github.com/SpectoLabs/hoverfly
3+
COPY . /usr/local/go/src/github.com/SpectoLabs/hoverfly
44
RUN cd core/cmd/hoverfly && CGO_ENABLED=0 GOOS=linux go install -ldflags "-s -w"
55

66
FROM alpine:latest

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ build:
4040

4141
build-ui:
4242
wget https://github.com/MegafonWebLab/hoverfly-ui/releases/download/v0.1.2/release.zip
43-
unzip release.zip -d hoverfly-ui
43+
mkdir hoverfly-ui
44+
unzip ./release.zip -d hoverfly-ui
4445
cd core && \
4546
statik -src=../hoverfly-ui/build
4647
rm -rf release.zip

core/admin.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ func (this *AdminApi) addDashboardRoutes(router *bone.Mux) *bone.Mux {
8686
router.HandleFunc("/simulations/new", indexHandler)
8787
router.HandleFunc("/simulations", indexHandler)
8888
router.HandleFunc("/settings", indexHandler)
89+
router.HandleFunc("/login", indexHandler)
8990
router.Handle("/", http.FileServer(statikFS))
9091
router.Handle("/*.js", http.FileServer(statikFS))
9192
router.Handle("/*.css", http.FileServer(statikFS))

0 commit comments

Comments
 (0)