Automate production of CAPI VM images #2
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 CAPI image builder | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| env: | |
| IMAGE_NAME: image-builder | |
| REGISTRY: ghcr.io/elastisys | |
| jobs: | |
| build-image-builder: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Get branch name | |
| id: get-branch-name | |
| run: | | |
| if [ "${{ github.event_name }}" == "pull_request" ]; then | |
| echo "BRANCH_NAME=${{ github.head_ref }}" >> $GITHUB_OUTPUT | |
| else | |
| echo "BRANCH_NAME=${GITHUB_REF##*/}" >> $GITHUB_OUTPUT | |
| fi | |
| shell: bash | |
| - name: run make docker-build | |
| run: make docker-build | |
| env: | |
| TAG: ${{ steps.get-branch-name.outputs.BRANCH_NAME }}-${{ github.sha }} | |
| - name: run make docker-push | |
| run: make docker-push | |
| env: | |
| TAG: ${{ steps.get-branch-name.outputs.BRANCH_NAME }}-${{ github.sha }} |