Build and Push Cluster Image #5
This file contains hidden or 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: Build and Push Cluster Image | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'containerfiles/cluster-image/**' | |
| pull_request: | |
| paths: | |
| - 'containerfiles/cluster-image/**' | |
| workflow_dispatch: | |
| inputs: | |
| push: | |
| description: 'Push image to registry' | |
| required: false | |
| default: 'false' | |
| type: boolean | |
| env: | |
| REGISTRY: ghcr.io | |
| IMAGE_NAME: ${{ github.repository }}/cluster | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Log in to GHCR | |
| if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.push) | |
| run: podman login -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }} ${{ env.REGISTRY }} | |
| - name: Build cluster image | |
| run: make build-cluster-image | |
| - name: Push | |
| if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.push) | |
| run: podman push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest |