forked from schizofreny/lvm-exporter
-
Notifications
You must be signed in to change notification settings - Fork 1
46 lines (38 loc) · 1.16 KB
/
pull_request.yaml
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
name: Build from pull request
on:
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Figure out if running fork PR
id: fork
run: '["${{ secrets.DOCKER_REGISTRY_TOKEN }}" == ""] && echo "::set-output name=is_fork_pr::true" || echo "::set-output name=is_fork_pr::false"'
- name: Docker Login
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_REGISTRY_USER }}
password: ${{ secrets.DOCKER_REGISTRY_TOKEN }}
if: steps.fork.outputs.is_fork_pr == 'false'
- name: Setup go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
cache: false
- name: Lint
uses: golangci/golangci-lint-action@v6
with:
args: --timeout=3m -p bugs -p unused
- name: Build
run: |
export GIT_TAG_NAME=${GITHUB_HEAD_REF##*/}
make dockerimages
- name: Push
run: |
export GIT_TAG_NAME=${GITHUB_HEAD_REF##*/}
make dockerpush
if: steps.fork.outputs.is_fork_pr == 'false'