forked from p3lim/pixie
-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (41 loc) · 1.32 KB
/
Copy pathpackage.yaml
File metadata and controls
47 lines (41 loc) · 1.32 KB
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
name: Create package
on:
push:
tags:
- '**'
jobs:
package:
runs-on: ubuntu-latest
steps:
- name: Build
uses: p3lim/pixie@master
with:
go_version: '1.16.9'
- name: Get tag
run: |
VERSION="${GITHUB_REF#refs/tags/}"
VERSION_MAJOR="${VERSION%%\.*}"
VERSION_MINOR="${VERSION%.*}"
echo "::set-output name=tag::$VERSION"
echo "::set-output name=major::$VERSION_MAJOR"
echo "::set-output name=minor::$VERSION_MINOR"
id: tag
- name: Build binaries
env:
CGO_ENABLED: 0
run: go build -ldflags="-X 'main.Version=${{ steps.tag.outputs.tag }}'" -o bin/pixie ./cmd/pixie
- name: Build image
uses: redhat-actions/buildah-build@v2
with:
containerfiles: Containerfile
image: pixie
tags: ${{ steps.tag.outputs.tag }} ${{ steps.tag.outputs.major }} ${{ steps.tag.outputs.minor }} ${{ github.sha }} latest
id: image
- name: Push image
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.image.outputs.image }}
tags: ${{ steps.image.outputs.tags }}
registry: ghcr.io/${{ github.repository_owner }}
username: ${{ github.actor }}
password: ${{ github.token }}