forked from craftlion/communautofinder_telegrambot
-
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.
- Change dependencies. - Change library. - Adding logging. - Add healthcheck. - Provide environment thru os env. - Create Buildah pipeline : OCI does not support HEALTHCHECK yet : opencontainers/image-spec#749 forced to docker format : containers/podman#18904 - Update README.
- Loading branch information
Showing
7 changed files
with
134 additions
and
56 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,55 @@ | ||
# This workflow will perform a test whenever there | ||
# is some change in code done to ensure that the changes | ||
# are not buggy and we are getting the desired output. | ||
name: Push to GHCR | ||
on: | ||
push: | ||
workflow_dispatch: | ||
env: | ||
IMAGE_NAME: communautofinder_telegrambot | ||
IMAGE_TAGS: latest | ||
IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }} | ||
REGISTRY_USER: ${{ github.actor }} | ||
REGISTRY_PASSWORD: ${{ github.token }} | ||
|
||
jobs: | ||
push-ghcr: | ||
name: Build and push image | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
# Checkout push-to-registry action github repository | ||
- name: Checkout Push to Registry action | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install latest podman | ||
if: matrix.install_latest | ||
run: | | ||
bash .github/install_latest_podman.sh | ||
# Build image using Buildah action | ||
- name: Build Image | ||
id: build_image | ||
uses: redhat-actions/buildah-build@v2 | ||
with: | ||
image: ${{ env.IMAGE_NAME }} | ||
tags: ${{ env.IMAGE_TAGS }} | ||
containerfiles: ./Containerfile | ||
oci: false | ||
|
||
# Push the image to GHCR (Image Registry) | ||
- name: Push To GHCR | ||
uses: redhat-actions/push-to-registry@v2 | ||
id: push | ||
with: | ||
image: ${{ steps.build_image.outputs.image }} | ||
tags: ${{ steps.build_image.outputs.tags }} | ||
registry: ${{ env.IMAGE_REGISTRY }} | ||
username: ${{ env.REGISTRY_USER }} | ||
password: ${{ env.REGISTRY_PASSWORD }} | ||
extra-args: | | ||
--disable-content-trust | ||
- name: Echo outputs | ||
run: | | ||
echo "${{ toJSON(steps.push.outputs) }}" |
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,22 @@ | ||
FROM golang:alpine as build | ||
|
||
WORKDIR /app | ||
|
||
COPY go.mod ./ | ||
COPY go.sum ./ | ||
RUN go mod download | ||
|
||
COPY *.go ./ | ||
|
||
RUN CGO_ENABLED=0 go build -ldflags "-s -w" -o ./communautoFinderBot | ||
RUN go clean -cache -testcache -fuzzcache -modcache | ||
|
||
FROM alpine | ||
RUN apk update && apk add --no-cache curl | ||
COPY --from=build /app /app | ||
WORKDIR /app | ||
EXPOSE 8443 8444 | ||
|
||
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 CMD curl http://localhost:8444/health || exit 1 | ||
|
||
CMD ./communautoFinderBot |
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
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,12 +1,12 @@ | ||
module github.com/craftlion/communautofinder_telegrambot | ||
module github.com/mguaylam/communautofinder_telegrambot | ||
|
||
go 1.20 | ||
|
||
require github.com/go-telegram-bot-api/telegram-bot-api v4.6.4+incompatible | ||
|
||
require github.com/joho/godotenv v1.5.1 | ||
require github.com/joho/godotenv v1.5.1 // indirect | ||
|
||
require ( | ||
github.com/craftlion/communautofinder v1.2.0 | ||
github.com/mguaylam/communautofinder v1.2.1 | ||
github.com/technoweenie/multipartstreamer v1.0.1 // indirect | ||
) |
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,8 +1,8 @@ | ||
github.com/craftlion/communautofinder v1.2.0 h1:eblDFzB36erPjZLRQC4lR5va2AP9Bh8OYB8MqfjRSyA= | ||
github.com/craftlion/communautofinder v1.2.0/go.mod h1:aUPA9bhCTDcsHax45j1149Hql6d1hNMLwI9TAAYEfso= | ||
github.com/go-telegram-bot-api/telegram-bot-api v4.6.4+incompatible h1:2cauKuaELYAEARXRkq2LrJ0yDDv1rW7+wrTEdVL3uaU= | ||
github.com/go-telegram-bot-api/telegram-bot-api v4.6.4+incompatible/go.mod h1:qf9acutJ8cwBUhm1bqgz6Bei9/C/c93FPDljKWwsOgM= | ||
github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= | ||
github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= | ||
github.com/mguaylam/communautofinder v1.2.1 h1:vvSp4tA/jVxHsq1g0LRV1eSozNPtmEU5tJHRewNaf0A= | ||
github.com/mguaylam/communautofinder v1.2.1/go.mod h1:dnvRAoTOGp8BHCY084W1QqUWGQ03hS/ZiX8yrdvz418= | ||
github.com/technoweenie/multipartstreamer v1.0.1 h1:XRztA5MXiR1TIRHxH2uNxXxaIkKQDeX7m2XsSOlQEnM= | ||
github.com/technoweenie/multipartstreamer v1.0.1/go.mod h1:jNVxdtShOxzAsukZwTSw6MDx5eUJoiEBsSvzDU9uzog= |
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