Skip to content

gh: Add workflow to build and push #7

gh: Add workflow to build and push

gh: Add workflow to build and push #7

Workflow file for this run

name: Build and Push Image
on:
push:
branches: ['main']
tags: ['v*']
pull_request:
branches: ['main']
env:
DO_PUSH: ${{ github.ref == 'refs/heads/main' || github.event_name == 'release' }}
jobs:
build-image:
name: Build image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build Image
id: build-image
uses: redhat-actions/buildah-build@v2
with:
image: wasp-agent
tags: latest ${{ github.sha }}
containerfiles: |
./Containerfile
push-image-to-quay:
name: Push image to quay.io
needs: build-image
if: env.DO_PUSH == 'true'

Check failure on line 32 in .github/workflows/build-n-push.yaml

View workflow run for this annotation

GitHub Actions / Build and Push Image

Invalid workflow file

The workflow is not valid. .github/workflows/build-n-push.yaml (Line: 32, Col: 9): Unrecognized named-value: 'env'. Located at position 1 within expression: env.DO_PUSH == 'true'
runs-on: ubuntu-latest
steps:
- 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/openshift-virtualization
username: openshift-virtualization+wasp_agent_gh_workflow
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Print image url
run: echo "Image pushed to ${{ steps.push-to-quay.outputs.registry-paths }}"