Skip to content

gemini-cli_v0.0.4

gemini-cli_v0.0.4 #7

Workflow file for this run

# This workflow deploys the production Docker image to Docker Hub
name: Publish to Docker Hub
on:
release:
types: [published]
env:
REGISTRY: docker.io
IMAGE_NAME: weaponsforge/gemini-cli
jobs:
docker-build-push:
name: Build and Push Docker Image
if: github.event.release.target_commitish == 'master' && vars.DOCKERHUB_USERNAME != ''
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
packages: write
steps:
- name: Checkout the repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.release.tag_name }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Generate Docker Image Tags and Labels
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
# type=semver,pattern={{major}}.{{minor}}
type=raw,value=latest,enable={{is_default_branch}}
- name: Build and Push Docker Image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
platforms: linux/amd64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
BUILDKIT_INLINE_CACHE=1
CACHEBUST=${{ github.run_id }}
- name: Scan Image for Vulnerabilities
uses: aquasecurity/[email protected]
with:
image-ref: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
format: 'sarif'
output: 'trivy-results.sarif'
- name: Upload Trivy Scan Results to GitHub Security Tab
uses: github/codeql-action/upload-sarif@v3
if: always()
with:
sarif_file: 'trivy-results.sarif'