diff --git a/.gitea/workflows/upload-image-dev.yaml b/.gitea/workflows/upload-image-dev.yaml index edb2625..7b5fae7 100644 --- a/.gitea/workflows/upload-image-dev.yaml +++ b/.gitea/workflows/upload-image-dev.yaml @@ -1,4 +1,5 @@ -Actions name: Publish Docker Image (Development) +name: Publish Docker Image (Development) + on: push: branches: @@ -9,7 +10,7 @@ jobs: runs-on: ubuntu-20.04 steps: - name: Checkout - uses: https://github.com/actions/checkout@v3 + uses: actions/checkout@v3 - name: Cache Docker uses: actions/cache@v3 @@ -27,33 +28,34 @@ jobs: echo "Done" - name: Set up Docker Buildx - uses: https://github.com/docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v2 - name: Login to Repo - uses: https://github.com/docker/login-action@v2 + uses: docker/login-action@v2 with: username: ${{ secrets.REPO_USERNAME }} password: ${{ secrets.REPO_TOKEN }} - name: Restore Docker Build Cache uses: actions/cache@v3 + id: build-cache with: path: /tmp/.buildx-cache key: ${{ runner.os }}-buildx - restore-keys: | - ${{ runner.os }}-buildx - name: Build and Push uses: docker/build-push-action@v4 with: push: true context: . - tags: fascinated/sharex-php-uploader:latest + tags: fascinated/sharex-php-uploader:development + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache - name: Save Docker Build Cache - uses: actions/cache@v3 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx - restore-keys: | - ${{ runner.os }}-buildx + if: steps.build-cache.outputs.cache-hit != 'true' + run: | + mkdir -p /tmp/.buildx-cache + cp -r /tmp/.buildx-cache/. /tmp/.buildx-cache-new + rm -rf /tmp/.buildx-cache + mv /tmp/.buildx-cache-new /tmp/.buildx-cache