name: Docker run-name: "Docker: ${{ github.sha }}" on: push: branches: [main] schedule: - cron: "0 6 * * *" workflow_dispatch: concurrency: group: docker-${{ github.ref }} cancel-in-progress: true jobs: build-and-push: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: ref: ${{ github.sha }} fetch-depth: 0 - name: Login to Gitea Package Registry uses: docker/login-action@v3 with: registry: gitea.steffenillium.de username: steffen password: ${{ secrets.TOKEN }} - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Build and push uses: docker/build-push-action@v5 with: context: . platforms: linux/amd64 push: true tags: | gitea.steffenillium.de/steffen/opencode-custom:latest gitea.steffenillium.de/steffen/opencode-custom:${{ github.sha }} cache-from: type=registry,ref=gitea.steffenillium.de/steffen/opencode-custom:buildcache cache-to: type=registry,ref=gitea.steffenillium.de/steffen/opencode-custom:buildcache,mode=max - name: Cleanup buildx if: always() run: docker buildx prune -af