mirror of
https://github.com/coollabsio/coolify.git
synced 2026-11-06 13:10:37 -04:00
ci(size): comment the size change on pull requests
This commit is contained in:
@@ -26,6 +26,7 @@ workflows:
|
||||
'.github/workflows/pr-quality.yaml':
|
||||
- 'peakoss/anti-slop@v0.3.0'
|
||||
'.github/workflows/pull-request.yaml':
|
||||
- 'actions/checkout@v7.0.1'
|
||||
- 'actions/download-artifact@v8.0.2'
|
||||
- 'docker/login-action@v4.7.0'
|
||||
'.github/workflows/release.yaml':
|
||||
|
||||
@@ -82,3 +82,38 @@ jobs:
|
||||
sources+=("oci-layout://${index%/index.json}@$(jq -r '.manifests[0].digest' "$index")")
|
||||
done
|
||||
docker buildx imagetools create --tag "ghcr.io/coollabsio/coolify:$TAG" "${sources[@]}"
|
||||
|
||||
size:
|
||||
name: Compare size with latest
|
||||
needs: build
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write # comment the size report on the pull request
|
||||
runs-on: ubuntu-26.04 # https://github.com/actions/runner-images
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- name: Check out the repository
|
||||
uses: actions/checkout@v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Download the built images
|
||||
uses: actions/download-artifact@v8.0.2
|
||||
with:
|
||||
pattern: image-*
|
||||
path: ${{ runner.temp }}/images
|
||||
|
||||
- name: Compare the size with the latest release
|
||||
env:
|
||||
IMAGE_NAME: pr-${{ github.event.pull_request.number }}
|
||||
OUTPUT_FILE: ${{ runner.temp }}/size.md
|
||||
run: |
|
||||
scripts/size.sh "$RUNNER_TEMP/images" coollabsio/coolify:latest
|
||||
cat "$OUTPUT_FILE" >> "$GITHUB_STEP_SUMMARY"
|
||||
|
||||
- name: Comment the size on the pull request
|
||||
if: ${{ github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' }}
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
PULL_REQUEST: ${{ github.event.pull_request.number }}
|
||||
run: gh pr comment "$PULL_REQUEST" --body-file "$RUNNER_TEMP/size.md" --edit-last --create-if-none
|
||||
|
||||
Reference in New Issue
Block a user