This repository was archived by the owner on Jan 23, 2026. It is now read-only.
Merge pull request #808 from evakhoni/fix_qemu #1592
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 container image | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| - release-* | |
| tags: | |
| - v* | |
| merge_group: | |
| env: | |
| PUSH: ${{ github.repository_owner == 'jumpstarter-dev' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/release-')) }} | |
| REGISTRY: quay.io | |
| QUAY_ORG: quay.io/jumpstarter-dev | |
| jobs: | |
| build-and-push-image: | |
| strategy: | |
| matrix: | |
| image: | |
| - jumpstarter-dev/jumpstarter Dockerfile | |
| - jumpstarter-dev/jumpstarter-utils Dockerfile.utils | |
| - jumpstarter-dev/jumpstarter-dev .devfile/Containerfile | |
| - jumpstarter-dev/jumpstarter-devspace .devfile/Containerfile.client | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| attestations: write | |
| id-token: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Get image name and container file | |
| run: | | |
| IMAGE="${{ matrix.image }}" | |
| IMAGE_NAME=$(echo $IMAGE | awk '{print $1}') | |
| CONTAINERFILE=$(echo $IMAGE | awk '{print $2}') | |
| echo "IMAGE_NAME=${IMAGE_NAME}" >> $GITHUB_ENV | |
| echo "IMAGE_NAME=${IMAGE_NAME}" | |
| echo "CONTAINERFILE=${CONTAINERFILE}" >> $GITHUB_ENV | |
| echo "CONTAINERFILE=${CONTAINERFILE}" | |
| - name: Get version | |
| if: ${{ env.PUSH == 'true' }} | |
| run: | | |
| VERSION=$(git describe --tags) | |
| VERSION=${VERSION#v} # remove the leading v prefix for version | |
| echo "VERSION=${VERSION}" >> $GITHUB_ENV | |
| echo "VERSION=${VERSION}" | |
| - name: Set image tags | |
| if: ${{ env.PUSH == 'true' }} | |
| id: set-tags | |
| run: | | |
| TAGS="${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }}" | |
| if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then | |
| TAGS="$TAGS,${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest" | |
| fi | |
| if [[ "${{ github.ref }}" == refs/heads/release-* ]]; then | |
| RELEASE_BRANCH_NAME=$(basename "${{ github.ref }}") | |
| TAGS="$TAGS,${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${RELEASE_BRANCH_NAME}" | |
| fi | |
| echo "tags=$TAGS" >> $GITHUB_OUTPUT | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to the Container registry | |
| uses: docker/login-action@v3 | |
| if: ${{ env.PUSH == 'true' }} | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: jumpstarter-dev+jumpstarter_ci | |
| password: ${{ secrets.QUAY_TOKEN }} | |
| - name: Extract metadata (tags, labels) for Docker | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
| - name: Build and push Docker image | |
| id: push | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: ${{ env.CONTAINERFILE }} | |
| push: ${{ env.PUSH }} | |
| tags: ${{ steps.set-tags.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| platforms: linux/amd64,linux/arm64 | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| - name: Generate artifact attestation | |
| uses: actions/attest-build-provenance@v1 | |
| if: ${{ env.PUSH == 'true' }} | |
| with: | |
| subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
| subject-digest: ${{ steps.push.outputs.digest }} | |
| push-to-registry: ${{ env.PUSH }} |