-
Notifications
You must be signed in to change notification settings - Fork 7
45 lines (42 loc) · 1.67 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
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: Build
on:
push:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Set Up Go
uses: actions/setup-go@v3
with:
go-version: 1.20
# - name: Pull Secret
# run: echo '${{ secrets.PULLSECRET }}' > ~/.docker/config.json
- name: Go Mod
run: go mod vendor
# - name: Build
# run: go build -v --mod=vendor -ldflags "-X github.com/rvanderp3/mapi-static-ip-controller/pkg/version.Raw=${{ vars.GITHUB_REF_NAME }} -X github.com/rvanderp3/mapi-static-ip-controller/pkg/version.Commit=${{ vars.GITHUB_SHA }}" -o "bin/mapi-static-ip-controller" ./cmd/mapi-static-ip-controller
- name: Build Image
id: build-image
uses: redhat-actions/[email protected]
with:
image: machine-ipam-controller
tags: latest ${{ github.sha }}
dockerfiles: ./Dockerfile
# Podman Login action (https://github.com/redhat-actions/podman-login) also be used to log in,
# in which case 'username' and 'password' can be omitted.
- name: Push To quay.io
id: push-to-quay
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build-image.outputs.image }}
tags: ${{ steps.build-image.outputs.tags }}
registry: quay.io/ocp-splat
username: ocp-splat+splat_team_push
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Print image url
run: echo "Image pushed to ${{ steps.push-to-quay.outputs.registry-paths }}"