-
Notifications
You must be signed in to change notification settings - Fork 153
113 lines (96 loc) · 2.52 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
name: continuous-integration
on:
push:
branches:
- master
tags:
- '*'
pull_request:
branches:
- master
env:
GO_VERSION: "~1.23.1"
jobs:
# Runs Golangci-lint on the source code
ci-go-lint:
name: ci-go-lint
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Set up Go 1.x
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
id: go
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
# Runs markdown-lint on the markdown files
ci-markdown-lint:
name: ci-markdown-lint
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: markdownlint-cli2-action
uses: DavidAnson/markdownlint-cli2-action@v17
# Executes Unit Tests
ci-unit-tests:
name: ci-unit-tests
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Set up Go 1.x
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
id: go
- name: Run unit tests
run: |
make test
# Builds mark binary
ci-build:
name: ci-build
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Set up Go 1.x
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
id: go
- name: Build mark
run: |
make build
# Build and push Dockerimage
ci-docker-build:
name: ci-docker-build
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build only (on commits)
uses: docker/build-push-action@v6
if: ${{ github.ref_type != 'tag' }}
with:
push: false
tags: kovetskiy/mark:latest
- name: Login to Docker Hub
uses: docker/login-action@v3
if: ${{ github.ref_type == 'tag' }}
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build and push (on tag)
uses: docker/build-push-action@v6
if: ${{ github.ref_type == 'tag' }}
with:
push: true
platforms: linux/amd64,linux/arm64
tags: |
kovetskiy/mark:${{ github.ref_name }}
kovetskiy/mark:latest