forked from HewlettPackard/lustre_exporter
-
Notifications
You must be signed in to change notification settings - Fork 21
55 lines (53 loc) · 1.56 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
name: Continuous Integration
on:
pull_request:
types:
- opened
- reopened
- synchronize
branches:
- master
push:
branches:
- master
tags:
- '**'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build-run-test:
runs-on: ubuntu-latest
steps:
- name: Check out repository contents
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build binary
run: |
docker build --tag lustre_exporter:binary -f docker/Dockerfile .
- name: Build rpm
run: |
docker build -t lustre_exporter:rpm -f docker/RPM-Dockerfile .
- name: Extract binary
if: startsWith(github.ref, 'refs/tags/v')
run: |
docker run --rm -v $PWD:/cpy lustre_exporter:binary
sudo chown -R $USER:$GROUP build
- name: Upload binary
uses: actions/[email protected]
if: startsWith(github.ref, 'refs/tags/v')
with:
name: lustre-exporter Binary ${{ github.ref_name }}
path: build/
- name: Extract rpm
if: startsWith(github.ref, 'refs/tags/v')
run: |
sudo rm -rf build
docker run --rm -v $PWD:/rpm lustre_exporter:rpm
sudo chown -R $USER:$GROUP build
- name: Upload RPM
uses: actions/[email protected]
if: startsWith(github.ref, 'refs/tags/v')
with:
name: lustre-exporter RPM ${{ github.ref_name }}
path: build/