Skip to content

Commit 03c5036

Browse files
authored
redone (#2)
* redone * added err validation for Send * weather error validation
1 parent 6582014 commit 03c5036

File tree

16 files changed

+617
-390
lines changed

16 files changed

+617
-390
lines changed

.dockerignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.git
2+
.github
3+
Dockerfile
4+
docker-compose.yml

.github/CODEOWNERS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Global admin
2+
* @Gasoid
3+
4+
# only golang files
5+
*.go @Gasoid

.github/workflows/ci.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Linter checks
2+
3+
on:
4+
push:
5+
# paths:
6+
# - '*.go'
7+
# - '**/*.go'
8+
branches-ignore:
9+
- master
10+
11+
12+
env:
13+
REGISTRY: ghcr.io
14+
IMAGE_NAME: ${{ github.repository }}
15+
16+
concurrency:
17+
group: ${{ github.workflow }}-${{ github.ref }}
18+
cancel-in-progress: true
19+
20+
21+
jobs:
22+
lint:
23+
name: Linter
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v2
27+
- run: mkdir build && touch build/index.html
28+
- name: golangci-lint
29+
uses: golangci/golangci-lint-action@v2
30+
with:
31+
version: v1.46
32+
33+
build-and-push-image:
34+
runs-on: ubuntu-latest
35+
permissions:
36+
contents: read
37+
packages: write
38+
39+
steps:
40+
- name: Checkout repository
41+
uses: actions/checkout@v2
42+
43+
- name: Log in to the Container registry
44+
uses: docker/login-action@v1
45+
with:
46+
registry: ${{ env.REGISTRY }}
47+
username: ${{ github.actor }}
48+
password: ${{ secrets.GITHUB_TOKEN }}
49+
50+
- name: Extract metadata (tags, labels) for Docker
51+
id: meta
52+
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
53+
with:
54+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
55+
56+
- name: Set up Docker Buildx
57+
id: buildx
58+
uses: docker/setup-buildx-action@v1
59+
60+
- name: Cache Docker layers
61+
uses: actions/cache@v2
62+
with:
63+
path: /tmp/.buildx-cache
64+
key: ${{ runner.os }}-buildx-${{ github.sha }}
65+
restore-keys: |
66+
${{ runner.os }}-buildx-
67+
- name: Build and push Docker image
68+
uses: docker/build-push-action@v2
69+
with:
70+
context: .
71+
push: true
72+
tags: ${{ steps.meta.outputs.tags }}
73+
labels: ${{ steps.meta.outputs.labels }}
74+
cache-from: type=local,src=/tmp/.buildx-cache
75+
cache-to: type=local,dest=/tmp/.buildx-cache-new
76+
77+
- name: Move cache
78+
run: |
79+
rm -rf /tmp/.buildx-cache
80+
mv /tmp/.buildx-cache-new /tmp/.buildx-cache

.github/workflows/golangci-lint.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ WORKDIR /code
33
ADD go.mod /code/
44
ADD go.sum /code/
55
RUN go mod download
6-
ADD *.go /code/
6+
ADD ./ /code/
77
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o /code/bot .
88

99
FROM alpine:3.6

bot.go

Lines changed: 0 additions & 146 deletions
This file was deleted.

0 commit comments

Comments
 (0)