Update all CI action images: #502
Workflow file for this run
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
name: For each commit and PR | |
on: | |
push: | |
pull_request: | |
jobs: | |
validation: | |
runs-on: ubuntu-latest | |
env: | |
CGO_ENABLED: 0 | |
steps: | |
- name: Checkout code | |
uses: actions/[email protected] | |
- name: Install Go | |
uses: actions/[email protected] | |
with: | |
go-version: '1.20' | |
- name: go fmt | |
run: go get golang.org/x/tools/cmd/goimports && goimports -d . | (! grep .) | |
- name: prepare go mod | |
run: go mod tidy | |
- name: go test | |
run: make test | |
- name: lint | |
run: make lint | |
- name: go test coverage | |
run: make test-ci | |
- name: upload codecov | |
run: bash <(curl -s https://codecov.io/bash) | |
- name: Build binaries | |
run: go build . | |
- name: Upload pbnj binary | |
uses: actions/[email protected] | |
with: | |
name: pbnj | |
path: ./pbnj | |
docker-images: | |
runs-on: ubuntu-latest | |
needs: [validation] | |
steps: | |
- name: Docker Image Tag for Sha | |
id: docker-image-tag | |
run: | | |
echo ::set-output name=tags::quay.io/tinkerbell/pbnj:latest,quay.io/tinkerbell/pbnj:sha-${GITHUB_SHA::8} | |
- name: Checkout code | |
uses: actions/[email protected] | |
- name: Download pbnj binary | |
uses: actions/[email protected] | |
with: | |
name: pbnj | |
path: ./pbnj | |
- name: set pbnj permission | |
run: chmod +x ./pbnj | |
- name: Set up Docker Buildx | |
uses: docker/[email protected] | |
- name: Login to quay.io | |
uses: docker/[email protected] | |
if: startsWith(github.ref, 'refs/heads/main') | |
with: | |
registry: quay.io | |
username: ${{ secrets.QUAY_USERNAME }} | |
password: ${{ secrets.QUAY_PASSWORD }} | |
- name: quay.io/tinkerbell/pbnj | |
uses: docker/[email protected] | |
with: | |
context: ./ | |
file: ./Dockerfile | |
cache-from: type=registry,ref=quay.io/tinkerbell/pbnj:latest | |
push: ${{ startsWith(github.ref, 'refs/heads/main') }} | |
tags: ${{ steps.docker-image-tag.outputs.tags }} |