name: build-container on: push: branches: [main] tags: ['v*'] workflow_dispatch: jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: docker/setup-qemu-action@v3 - uses: docker/setup-buildx-action@v3 # Repo secrets needed (Settings -> Actions -> Secrets): # REGISTRY_TOKEN a Gitea access token with write:package scope # REGISTRY_USER optional; defaults to the user who pushed - uses: docker/login-action@v3 with: registry: git.necloud.us username: ${{ secrets.REGISTRY_USER || gitea.actor }} password: ${{ secrets.REGISTRY_TOKEN }} - id: meta uses: docker/metadata-action@v5 with: images: git.necloud.us/nate/hub tags: | type=raw,value=latest,enable={{is_default_branch}} type=sha,format=short type=ref,event=tag - uses: docker/build-push-action@v6 with: context: . platforms: linux/amd64,linux/arm64 push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} cache-from: type=registry,ref=git.necloud.us/nate/hub:buildcache cache-to: type=registry,ref=git.necloud.us/nate/hub:buildcache,mode=max