name: Build and push Docker images on: push: branches: - main pull_request: branches: - main jobs: build-and-push: runs-on: ubuntu-latest timeout-minutes: 1440 permissions: contents: read packages: write attestations: write id-token: write env: REGISTRY: docker.io IMAGE_NAME: niccolon/raptor-deps:mlir0c2701f steps: - name: Checkout repository run: | git clone --depth 1 --branch ${GITHUB_REF_NAME} \ https://chef.heaplab.deib.polimi.it/git/${GITHUB_REPOSITORY}.git \ ${GITHUB_WORKSPACE} - name: Install buildah run: | sudo apt-get update sudo apt-get install -y buildah - name: Build Image id: build-image uses: redhat-actions/buildah-build@v2 with: image: ${{ env.IMAGE_NAME }} tags: latest containerfiles: | ./mlir0c2701f/Dockerfile context: ./mlir0c2701f - name: Push Image if: github.ref == 'refs/heads/main' uses: redhat-actions/push-to-registry@v2 with: image: ${{ steps.build-image.outputs.image }} tags: ${{ steps.build-image.outputs.tags }} registry: ${{ env.REGISTRY }} username: niccolon password: ${{ secrets.DOCKERHUB_TOKEN }}