update docker image workflow
All checks were successful
Docker image CD / build_and_push (push) Successful in 21m46s

- add cache
- add step to send webhook to rebuild container
This commit is contained in:
sudacode 2025-02-05 00:09:49 -08:00
parent b69f578972
commit 691bdf85a2

View File

@ -31,9 +31,6 @@ jobs:
id: buildx
uses: docker/setup-buildx-action@v2
# - name: Log in to Gitea Docker Registry
# run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login https://gitea.suda.codes -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
@ -52,3 +49,21 @@ jobs:
tags: |
gitea.suda.codes/sudacode/${{ steps.meta.outputs.REPO_NAME }}:${{ steps.meta.outputs.REPO_VERSION }}
gitea.suda.codes/sudacode/${{ steps.meta.outputs.REPO_NAME }}:latest
cache-from: type=local,src=${{ runner.temp }}/.buildx-cache
cache-to: type=local,dest=${{ runner.temp }}/.buildx-cache-new,mode=max
- # Temp fix
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
name: Move cache
run: |
rm -rf ${{ runner.temp }}/.buildx-cache
mv ${{ runner.temp }}/.buildx-cache-new ${{ runner.temp }}/.buildx-cache
- name: Invoke deployment hook
uses: distributhor/workflow-webhook@v3
with:
webhook_url: ${{ secrets.WEBHOOK_URL }}
webhook_auth: ${{ secrets.WEBHOOK_AUTH }}
webhook_secret: ${{ secrets.WEBHOOK_SECRET }}
webhook_auth_type: bearer