-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update dependencies * Update go version * feat: implement missing crud handlers for investors locations and statuses * unify api behavior * add possibility to include decision date in location creation and update * update readme * preload locations status when fetching office * update application schema * fix investment status preloading when fetching investor * add package publishing gh action * add missing argument * create minimal docker image configuration * remove duplicated functions * update dependencies
- Loading branch information
1 parent
5272a66
commit 002dd8c
Showing
12 changed files
with
172 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: hedgeapp backend | ||
|
||
on: | ||
push: | ||
branches: [master, develop] | ||
|
||
jobs: | ||
build-and-publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GH_PAT }} | ||
|
||
- name: Set image tag | ||
run: | | ||
if [[ $GITHUB_REF == refs/heads/master ]]; then | ||
IMAGE_TAG=latest | ||
elif [[ $GITHUB_REF == refs/heads/develop ]]; then | ||
IMAGE_TAG=develop | ||
fi | ||
echo "IMAGE_TAG=$IMAGE_TAG" >> $GITHUB_ENV | ||
- name: Build and push docker image | ||
run: | | ||
docker build --tag ghcr.io/szarbartosz/hedgeapp-back:$IMAGE_TAG . | ||
docker push ghcr.io/szarbartosz/hedgeapp-back:$IMAGE_TAG |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,23 @@ | ||
FROM golang:1.22.3-alpine | ||
# build a binary | ||
FROM golang:1.22.3-alpine AS builder | ||
|
||
WORKDIR /app | ||
RUN apk update && apk add --no-cache 'git=~2' | ||
|
||
COPY go.mod go.sum ./ | ||
RUN go mod download | ||
|
||
ENV GO111MODULE=on | ||
WORKDIR /app | ||
COPY . . | ||
|
||
RUN go build -o main . | ||
RUN go get -d -v | ||
|
||
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o /binary . | ||
|
||
# build a small image | ||
FROM alpine:3 | ||
|
||
WORKDIR / | ||
COPY --from=builder /binary /main | ||
|
||
EXPOSE 8080 | ||
|
||
CMD ["./main"] | ||
ENTRYPOINT ["/main"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.