Skip to content

Commit

Permalink
pr caching
Browse files Browse the repository at this point in the history
  • Loading branch information
gorkemgoknar committed Oct 30, 2023
1 parent 41384d5 commit 5e3fb8d
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions .github/workflows/build-and-push-to-ghcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,6 @@ jobs:
name: Checkout
uses: actions/checkout@v3

- name: Set Release version
shell: bash
run: |
if [[ "$GITHUB_EVENT_NAME" == "pull_request" ]]; then
echo "RELEASE_VERSION=dev" >> $GITHUB_ENV
else
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
fi
export TAG=${GHCR_URL}:${{ env.RELEASE_VERSION }}-${{ github.sha }}
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand All @@ -37,9 +28,9 @@ jobs:
with:
context: "{{defaultContext}}:server"
file: Dockerfile
push: false
cache-from: type=registry,ref=ghcr.io/coqui-ai/xtts-streaming-server:latest-cache
cache-to: type=registry,ref=ghcr.io/coqui-ai/xtts-streaming-server:latest-cache
push: false # Do not push image for PR
cache-from: type=registry,ref=ghcr.io/coqui-ai/xtts-streaming-server:cache-pr-${{ github.event.pull_request.head.sha }}
cache-to: type=registry,ref=ghcr.io/coqui-ai/xtts-streaming-server:cache-pr-${{ github.event.pull_request.head.sha }}
tags: coqui-ai/xtts-streaming-server:${{ env.RELEASE_VERSION }}-${{ github.sha }}
#build-args:

Expand All @@ -49,9 +40,9 @@ jobs:
with:
context: "{{defaultContext}}:server"
file: Dockerfile
push: false
cache-from: type=registry,ref=ghcr.io/coqui-ai/xtts-streaming-server:latest-cache
cache-to: type=registry,ref=ghcr.io/coqui-ai/xtts-streaming-server:latest-cache
push: true # Push if merged
cache-from: type=registry,ref=ghcr.io/coqui-ai/xtts-streaming-server:cache-latest
cache-to: type=registry,ref=ghcr.io/coqui-ai/xtts-streaming-server:cache-latest
tags: coqui-ai/xtts-streaming-server:latest, coqui-ai/xtts-streaming-server:${{ env.RELEASE_VERSION }}-${{ github.sha }}
#build-args:

0 comments on commit 5e3fb8d

Please sign in to comment.