-
Notifications
You must be signed in to change notification settings - Fork 1
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
1 parent
319bb31
commit fc94dc3
Showing
7 changed files
with
94 additions
and
57 deletions.
There are no files selected for viewing
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,62 @@ | ||
name: Build and Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
jobs: | ||
build-and-release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.23' | ||
|
||
- name: Build binary | ||
run: | | ||
mkdir -p release | ||
GOOS=linux GOARCH=amd64 go build -o release/beacon-${GITHUB_REF_NAME}-linux-amd64 | ||
# - name: Create GitHub release | ||
# uses: actions/create-release@v1 | ||
# with: | ||
# tag_name: ${{ github.ref_name }} | ||
# release_name: ${{ github.ref_name }} | ||
# body: "Version: ${{ github.ref_name }}" | ||
# draft: false | ||
# prerelease: false | ||
# token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
# - name: Upload release binary | ||
# uses: actions/upload-release-asset@v2 | ||
# with: | ||
# repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
# release_id: ${{ steps.create_release.outputs.id }} | ||
# asset_path: ./release/* | ||
# asset_name: ${{ basename }} | ||
# asset_content_type: application/octet-stream | ||
|
||
- name: Log in to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Build and Push Docker Image | ||
uses: docker/build-push-action@v5 | ||
env: | ||
BEACON_VERSION: ${{ github.ref_name }} | ||
release/beacon-${GITHUB_REF_NAME}-linux-amd64 | ||
with: | ||
push: true | ||
file: ./Dockerfile | ||
build-args: | | ||
beacon_binary=release/beacon-${GITHUB_REF_NAME}-linux-amd64 | ||
tags: | | ||
davidmasek/beacon:latest | ||
davidmasek/beacon:${{ github.ref_name }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,11 @@ | ||
FROM golang:1.23 | ||
FROM debian:bullseye-slim | ||
|
||
WORKDIR /app | ||
|
||
ENV GOCACHE=/root/.cache/go-build | ||
ENV GOMODCACHE=/root/go/pkg/mod | ||
ARG beacon_binary | ||
ADD ${beacon_binary} /app/beacon | ||
|
||
# pre-copy/cache go.mod for pre-downloading dependencies and only re-downloading them in subsequent builds if they change | ||
COPY go.mod go.sum ./ | ||
RUN --mount=type=cache,target=/root/go/pkg/mod \ | ||
go mod download && go mod verify | ||
WORKDIR /app | ||
|
||
COPY . . | ||
RUN --mount=type=cache,target=/root/.cache/go-build \ | ||
go build | ||
ENV BEACON_DB=/app/beacon.db | ||
|
||
ENTRYPOINT ["./beacon"] | ||
CMD ["start"] | ||
ENTRYPOINT ["/app/beacon"] | ||
CMD ["start", "--config", "/app/beacon.yaml"] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
services: | ||
example-heartbeat-service: | ||
example-web-service: | ||
example-backup-job: | ||
example-website: | ||
url: "" | ||
|
||
email: | ||
|