forked from ricoberger/script_exporter
-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (54 loc) · 1.75 KB
/
build-deploy-pipeline.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Build, Deploy pipeline
permissions:
checks: write
contents: read
on:
push:
branches:
- main
- master
jobs:
release:
runs-on: ubuntu-latest
name: Release
steps:
- name: Set up Go 1.13
uses: actions/setup-go@v5
with:
go-version: 1.13
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Get dependencies
run: go mod download
- name: Test
run: go test ./...
- name: Build
run: make release
- name: Upload
run: |
./upload.sh ./bin/script_exporter-darwin-amd64 application/x-binary
./upload.sh ./bin/script_exporter-linux-amd64 application/x-binary
./upload.sh ./bin/script_exporter-linux-armv7 application/x-binary
./upload.sh ./bin/script_exporter-linux-arm64 application/x-binary
./upload.sh ./bin/script_exporter-windows-amd64.exe application/x-binary
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
docker:
runs-on: ubuntu-latest
steps:
- name: Log in to docker.artifactory.brandwatch.com
uses: docker/login-action@v3
with:
registry: docker.artifactory.brandwatch.com
username: github-actions-docker-push
password: ${{ secrets.ARTIFACTORY_DOCKER_PUSH_PASSWORD }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v6
with:
push: true
tags: |
${{ format('{0}/{1}-{2}', github.event.repository.name, github.ref_name, 'amd64') }}
${{ format('{0}/{1}-{2}', github.event.repository.name, github.ref_name, github.run_id) }}