-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (59 loc) · 1.7 KB
/
build.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
name: Go
on:
push:
branches:
- main
paths-ignore:
- "README.md"
- "docs/**"
- ".github/**"
- ".img/**"
- "config.yaml"
- "dockerfile"
- ".dockerignore"
- ".gitignore"
- "LICENSE"
release:
types: [created]
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Git Version
id: version
uses: paulhatch/[email protected]
with:
tag_prefix: "v"
version_format: ${{ github.event_name == 'release' && '${major}.${minor}.${patch}' || '${major}.${minor}.${patch}-prerelease${increment}' }}
- name: Setup buildx
uses: docker/setup-buildx-action@v3
- name: Run make
run: |
VERSION=${{ steps.version.outputs.version }} make docker-build
- name: Login to GitHub Container Registry
if: github.event_name == 'push' || github.event_name == 'release'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Publish Image
if: github.event_name == 'push' || github.event_name == 'release'
run: |
VERSION=${{ steps.version.outputs.version }} make docker-push
- name: Publish Helm Chart
if: github.event_name == 'push' || github.event_name == 'release'
run: |
VERSION=${{ steps.version.outputs.version }} make helm-push