-
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
1 parent
44b70ee
commit 3d9b196
Showing
2 changed files
with
42 additions
and
0 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,25 @@ | ||
name: Release | ||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
# Builds the image and publishes it on docker hub | ||
build_and_push_docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout the repository | ||
uses: actions/checkout@v3 | ||
- name: Build container | ||
run: docker build --build-arg VERSION=${{ github.ref_name }} -t cubicrootxyz/trollinfo:latest . | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Push image (latest) | ||
run: docker push cubicrootxyz/remindme:latest | ||
- name: Tag image with version | ||
run: docker tag cubicrootxyz/remindme:latest cubicrootxyz/remindme:${{ github.event.release.tag_name }} | ||
- name: Push image (version) | ||
run: docker push cubicrootxyz/remindme:${{ github.event.release.tag_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
FROM golang:1.22 as builder | ||
ARG VERSION="development" | ||
|
||
WORKDIR /run | ||
|
||
COPY ./ ./ | ||
RUN go mod download | ||
RUN go build -ldflags="-w -s -X github.com/CubicrootXYZ/matrix-reminder-and-calendar-bot/cmd.Version=${VERSION}" -o /run ./cmd/remindme | ||
|
||
FROM golang:1.22 | ||
RUN apt update && apt upgrade -y && \ | ||
apt install -y gcc && \ | ||
apt install libolm-dev npm -y | ||
COPY --from=builder /run/remindme /run/ | ||
WORKDIR /run | ||
|
||
CMD ["/run/remindme"] |