Update build.yml #5
This file contains 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: Podman Build | |
on: | |
push: | |
branches: [ AMD_APU_GTT_memory ] | |
pull_request: | |
branches: [ AMD_APU_GTT_memory ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
container: | |
image: debian:bullseye-slim # Use the docker container for podman | |
options: --privileged # Important: Required for podman in docker | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Install Podman and dependencies | |
run: | | |
apt-get update | |
apt-get install -y podman | |
- name: Add Docker Hub registry to registries.conf | |
run: | | |
echo '[docker.io]' >> /etc/containers/registries.conf | |
- name: Build with Podman | |
run: | | |
podman build -f Dockerfile --no-cache --platform=linux/amd64 --target runtime-rocm --build-arg OLLAMA_SKIP_CUDA_GENERATE=1 -t ollama-gtt | |
- name: Export image as tar | |
run: | | |
podman save ollama-gtt -o ollama-gtt.tar | |
- name: Create GitHub Release | |
if: github.event_name == 'push' | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: v${{ github.sha }} | |
release_name: Release v${{ github.sha }} | |
- name: Upload tar to Release | |
if: github.event_name == 'push' | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ollama-gtt.tar | |
asset_name: ollama-gtt.tar |