A GitHub Action to build custom VM0 images from a Dockerfile.
- name: Build VM0 Image
uses: vm0-ai/image-build-action@v1
with:
name: my-custom-image
vm0-token: ${{ secrets.VM0_TOKEN }}| Input | Required | Default | Description |
|---|---|---|---|
working-directory |
No | . |
Working directory for running the build command |
dockerfile |
No | Dockerfile |
Path to Dockerfile (relative to working-directory) |
name |
Yes | - | Name for the image |
delete-existing |
No | false |
Delete existing image before building |
vm0-token |
Yes | - | VM0 authentication token |
vm0-api-url |
No | https://www.vm0.ai |
VM0 API URL |
cli-version |
No | latest |
@vm0/cli version to install |
| Output | Description |
|---|---|
image-id |
The image ID |
name |
The image name |
name: Build Image
on:
push:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build VM0 Image
uses: vm0-ai/image-build-action@v1
with:
name: my-custom-image
vm0-token: ${{ secrets.VM0_TOKEN }}- name: Build VM0 Image
uses: vm0-ai/image-build-action@v1
with:
dockerfile: docker/Dockerfile.prod
name: my-custom-image
vm0-token: ${{ secrets.VM0_TOKEN }}- name: Build VM0 Image
uses: vm0-ai/image-build-action@v1
with:
working-directory: packages/my-service
name: my-custom-image
vm0-token: ${{ secrets.VM0_TOKEN }}- name: Build VM0 Image
uses: vm0-ai/image-build-action@v1
with:
name: my-custom-image
delete-existing: true
vm0-token: ${{ secrets.VM0_TOKEN }}- name: Build VM0 Image
id: build
uses: vm0-ai/image-build-action@v1
with:
name: my-custom-image
vm0-token: ${{ secrets.VM0_TOKEN }}
- name: Print Results
run: |
echo "Image Name: ${{ steps.build.outputs.name }}"
echo "Image ID: ${{ steps.build.outputs.image-id }}"To use this action, you need a VM0 authentication token:
- Install the VM0 CLI:
npm install -g @vm0/cli - Login:
vm0 auth login - Export token:
vm0 auth setup-token - Add to GitHub Secrets as
VM0_TOKEN
# Export token and add to GitHub secrets
vm0 auth setup-token | gh secret set VM0_TOKENMIT