name: Build and Push Document Worker on: push: branches: - main paths: - 'server/documents/worker/**' - 'docker/Dockerfile.documents' - '.github/workflows/build-document-worker.yml' workflow_dispatch: permissions: contents: read packages: write jobs: build: name: Build document-worker image runs-on: ubuntu-latest timeout-minutes: 50 steps: - name: Checkout uses: actions/checkout@v4 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Login to GitHub Container Registry uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Docker meta id: meta uses: docker/metadata-action@v5 with: images: ghcr.io/${{ github.repository_owner }}/iistwin-document-worker tags: | type=sha,prefix=,suffix=,format=short type=raw,value=latest,enable={{is_default_branch}} - name: Build and push uses: docker/build-push-action@v5 with: context: . file: docker/Dockerfile.documents push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} build-args: | ALPINE_MIRROR=mirrors.aliyun.com cache-from: type=gha cache-to: type=gha,mode=max