no result<> #160
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 Docker Images | |
| on: | |
| push: | |
| branches: | |
| - master | |
| jobs: | |
| setup: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| repo_name: ${{ steps.repo_name.outputs.lowercase }} | |
| steps: | |
| - name: Set repository name to lowercase | |
| id: repo_name | |
| run: echo "lowercase=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT | |
| build: | |
| needs: setup | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - 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 GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build Docker image and extract binary | |
| run: | | |
| # Build the Docker image | |
| docker build -f Dockerfile.build -t rust-cuda-builder . | |
| # Create a container from the image | |
| CONTAINER_ID=$(docker create rust-cuda-builder) | |
| # Create output directory | |
| mkdir -p artifacts | |
| # Copy the binary | |
| docker cp $CONTAINER_ID:/app/target/release/gpu_runner ./artifacts/ | |
| docker cp $CONTAINER_ID:/app/target/cuda-builder/nvptx64-nvidia-cuda/release/kernels.ptx ./artifacts/ | |
| echo "Copied to artifacts directory" | |
| # Remove the container | |
| docker rm $CONTAINER_ID | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: gpu_runner | |
| path: artifacts/ |