-
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.
- Loading branch information
Showing
23 changed files
with
1,379 additions
and
1,698 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,36 @@ | ||
name: Bus | ||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Extract tag version | ||
id: tag_version | ||
run: echo "VALUE=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT | ||
|
||
- name: Extract git commit hash | ||
id: git_commit | ||
run: echo "VALUE=$(git rev-list -1 HEAD)" >> $GITHUB_OUTPUT | ||
|
||
- name: build and deploy | ||
env: | ||
VERSION: ${{ steps.tag_version.outputs.VALUE }} | ||
GIT_COMMIT: ${{ steps.git_commit.outputs.VALUE }} | ||
run: | | ||
docker build \ | ||
--build-arg GIT_COMMIT=${{ env.GIT_COMMIT }} \ | ||
--build-arg VERSION=${{ env.VERSION }} \ | ||
--no-cache \ | ||
--progress=plain \ | ||
-t ellato/bus:${{ env.VERSION }} -t ellato/bus:latest . | ||
echo ${{ secrets.ELLA_DOCKER_TOKEN }} | docker login -u ellato --password-stdin | ||
docker push ellato/bus:${{ env.VERSION }} | ||
docker push ellato/bus:latest |
This file was deleted.
Oops, something went wrong.
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,29 @@ | ||
############################################################################### | ||
### build stage | ||
############################################################################### | ||
FROM golang:1.23-alpine3.20 AS builder | ||
|
||
## INSTALL DEPENDENCIES | ||
RUN apk add --update --no-cache curl git make musl-dev gcc bash | ||
|
||
WORKDIR /src | ||
|
||
COPY . . | ||
|
||
## TEST GO UNIT TESTS | ||
RUN go test -race -timeout 100s ./... -v | ||
|
||
ARG GIT_COMMIT | ||
ARG VERSION | ||
|
||
## BUILD API | ||
RUN go build -ldflags="-w -s -X main.GitCommit=${GIT_COMMIT} -X main.Version=${VERSION}" -o ./bin/bus cmd/bus/main.go | ||
|
||
############################################################################### | ||
### run stage | ||
############################################################################### | ||
FROM alpine:3.20 | ||
COPY --from=builder /src/bin/bus ./bus | ||
|
||
EXPOSE 2021 | ||
CMD ["./bus", "server"] |
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.