Merge pull request #16 from vr4manta/fix-ci-deploy-errors #18
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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.19 | |
# - 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 }}" |