Files
nanobot/.gitea/workflows/docker-build.yaml
T
Sagent fcdde47194
Docker Build and Push / build (push) Successful in 3m44s
fix: clone HKUDS/nanobot source before build (like Jenkinsfile)
2026-05-29 22:09:01 +00:00

51 lines
1.3 KiB
YAML

name: Docker Build and Push
on:
pull_request:
branches: [main]
push:
branches: [main]
schedule:
- cron: '0 0 * * *'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Clone HKUDS/nanobot source
run: git clone --depth 1 https://github.com/HKUDS/nanobot.git external-nanobot
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Login to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Docker metadata
id: meta
uses: docker/metadata-action@v6
with:
images: jcabillot/nanobot
tags: |
#type=ref,event=branch
#type=ref,event=pr
#type=sha
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
- name: Build and push
uses: docker/build-push-action@v7
with:
context: external-nanobot
file: external-nanobot/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
pull: true