@@ -16,24 +16,43 @@ jobs:
1616 needs : files-changed
1717 runs-on : ubuntu-latest
1818 steps :
19+ - name : Get cleaned branch name
20+ id : clean_name
21+ run : |
22+ # if main then say nightly otherwise cleanup name
23+ if [ "${{ github.base_ref }}" = "refs/heads/main" ]; then
24+ echo "branch=nightly" >> "$GITHUB_OUTPUT"
25+ exit 0
26+ fi
27+ REF_NAME=$(echo "${{ github.base_ref }}" | sed -e 's/refs\/heads\///' -e 's/refs\/tags\///' -e 's/release\/v//')
28+ echo "branch=${REF_NAME}-nightly" >> "$GITHUB_OUTPUT"
1929 - uses : docker/setup-buildx-action@v3
2030 - uses : docker/build-push-action@v5
2131 with :
2232 push : false
2333 tags : gitea/gitea:linux-amd64
24- cache-from : type=registry,ref=gitea/gitea:buildcache-pr- amd64
25- cache-to : type=registry,ref=gitea/gitea:buildcache-pr-amd64,mode=max
34+ platforms : linux/ amd64,linux/arm64,linux/riscv64
35+ cache-from : type=registry,ref=gitea/gitea:buildcache-${{ steps.clean_name.outputs.branch }}
2636
2737 rootless :
2838 if : needs.files-changed.outputs.docker == 'true' || needs.files-changed.outputs.actions == 'true'
2939 needs : files-changed
3040 runs-on : ubuntu-latest
3141 steps :
42+ - name : Get cleaned branch name
43+ id : clean_name
44+ run : |
45+ # if main then say nightly otherwise cleanup name
46+ if [ "${{ github.base_ref }}" = "refs/heads/main" ]; then
47+ echo "branch=nightly" >> "$GITHUB_OUTPUT"
48+ exit 0
49+ fi
50+ REF_NAME=$(echo "${{ github.base_ref }}" | sed -e 's/refs\/heads\///' -e 's/refs\/tags\///' -e 's/release\/v//')
51+ echo "branch=${REF_NAME}-nightly" >> "$GITHUB_OUTPUT"
3252 - uses : docker/setup-buildx-action@v3
3353 - uses : docker/build-push-action@v5
3454 with :
3555 push : false
3656 file : Dockerfile.rootless
3757 tags : gitea/gitea:linux-amd64
38- cache-from : type=registry,ref=gitea/gitea:buildcache-pr-amd64-rootless
39- cache-to : type=registry,ref=gitea/gitea:buildcache-pr-amd64-rootless,mode=max
58+ cache-from : type=registry,ref=gitea/gitea:buildcache-${{ steps.clean_name.outputs.branch }}-rootless
0 commit comments