Skip to content

doc: add test cases folder and documentation, updated gitignore and i… #6

doc: add test cases folder and documentation, updated gitignore and i…

doc: add test cases folder and documentation, updated gitignore and i… #6

Workflow file for this run

name: Create Container
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
on:
push:
branches: [ "main" ]
# Publish semver tags as releases.
tags: [ 'v*.*.*' ]
paths-ignore:
- 'manifests/**'
- 'examples/**'
- 'tests/**'
- 'README.md'
- '.gitignore'
env:
REGISTRY: quay.io
IMAGE_NAME: powercloud/power-dev-plugin
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Go 1.23.x
uses: actions/setup-go@v5
with:
go-version: '1.23.x'
# Eventually we should build inline...
- name: Build the binaries
run: |
GOOS=linux GOARCH=amd64 go build -o bin/power-dev-plugin-x86_64 cmd/power-dev-plugin/main.go
GOOS=linux GOARCH=ppc64le go build -o bin/power-dev-plugin-ppc64le cmd/power-dev-plugin/main.go
GOOS=linux GOARCH=s390x go build -o bin/power-dev-plugin-s390x cmd/power-dev-plugin/main.go
# Install the cosign tool except on PR
# https://github.com/sigstore/cosign-installer
- name: Install cosign
if: github.event_name != 'pull_request'
uses: sigstore/cosign-installer@v3.7.0
with:
cosign-release: 'v2.4.1'
# Workaround: https://github.com/docker/build-push-action/issues/461
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v3
# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.QUAY_USER }}
password: ${{ secrets.QUAY_TOKEN }}
# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/ppc64le,linux/amd64,linux/s390x
file: build/Containerfile-build
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}