Commit Stage #17
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: Commit Stage | |
on: | |
schedule: # Every Monday | |
- cron: '0 0 * * 1' | |
workflow_dispatch: | |
env: | |
REGISTRY: ghcr.io | |
ORGANIZATION: thomasvitale | |
VERSION: ${{ github.sha }} | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
permissions: | |
contents: read | |
packages: write | |
security-events: write | |
strategy: | |
fail-fast: false | |
matrix: | |
project: [ | |
{directory: ollama/llama2, name: ollama-llama2}, | |
{directory: ollama/mistral, name: ollama-mistral}, | |
{directory: ollama/orca-mini, name: ollama-orca-mini}, | |
{directory: ollama/phi, name: ollama-phi} | |
] | |
steps: | |
- name: Check out source code | |
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: Login to container registry | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ github.actor }} | |
password: ${{ secrets.IMAGE_PUSH_TOKEN }} | |
registry: ${{ env.REGISTRY }} | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
context: ${{ matrix.project.directory }} | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: | | |
${{ env.REGISTRY }}/${{ env.ORGANIZATION }}/${{ matrix.project.name }}:${{ env.VERSION }} | |
${{ env.REGISTRY }}/${{ env.ORGANIZATION }}/${{ matrix.project.name }}:latest | |
labels: | | |
org.opencontainers.image.licenses='Apache-2.0' | |
org.opencontainers.image.revision=${{ github.sha }} | |
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }} | |
org.opencontainers.image.version=${{ env.VERSION }} | |
org.opencontainers.image.url=${{ github.server_url }}/${{ github.repository }} |