Skip to content

Commit

Permalink
Fix admin redirect and add docker cache
Browse files Browse the repository at this point in the history
  • Loading branch information
Ziedelth committed Jul 2, 2024
1 parent bf5af6b commit 47c8bea
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
17 changes: 15 additions & 2 deletions .github/workflows/development_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,14 @@ jobs:
- name: Build
run: gradle clean installDist -x test

- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-docker-staging-${{ matrix.platform }}-${{ hashFiles('Dockerfile') }}
restore-keys: |
${{ runner.os }}-docker-staging-${{ matrix.platform }}-
- name: Build and push by digest
id: build
uses: docker/build-push-action@v6
Expand All @@ -78,8 +86,8 @@ jobs:
platforms: ${{ matrix.platform }}
labels: ${{ steps.meta.outputs.labels }}
outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true
cache-from: type=registry,ref=${{ env.REGISTRY_IMAGE }}:buildcache
cache-to: type=registry,ref=${{ env.REGISTRY_IMAGE }}:buildcache,mode=max
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new

- name: Export digest
run: |
Expand All @@ -95,6 +103,11 @@ jobs:
if-no-files-found: error
retention-days: 1

- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
merge:
runs-on: ubuntu-latest
needs:
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/fr/shikkanime/modules/Routing.kt
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ private suspend fun handleRequest(
when (response.type) {
ResponseType.MULTIPART -> handleMultipartResponse(call, response)
ResponseType.TEMPLATE -> handleTemplateResponse(call, controller, replacedPath, response)
ResponseType.REDIRECT -> call.respondRedirect(response.data as String, true)
ResponseType.REDIRECT -> call.respondRedirect(response.data as String, !replacedPath.startsWith("/admin"))
else -> call.respond(response.status, response.data ?: "")
}
} catch (e: Exception) {
Expand Down

0 comments on commit 47c8bea

Please sign in to comment.