مراية لـ
https://github.com/postalserver/postal.git
تم المزامنة 2026-01-17 05:33:35 +00:00
chore(github-actions): include a version string on branch-*/latest images
هذا الالتزام موجود في:
26
.github/workflows/ci.yml
مباع
26
.github/workflows/ci.yml
مباع
@@ -73,21 +73,33 @@ jobs:
|
|||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- id: tag
|
- id: info
|
||||||
run: |
|
run: |
|
||||||
TAG="${GITHUB_REF#refs/heads/}"
|
IMAGE=ghcr.io/postalserver/postal
|
||||||
if [ -z "$TAG" ]; then exit 1; fi
|
|
||||||
if [[ $TAG == "main" ]]; then TAG="latest"; else TAG="branch-${TAG}"; fi
|
REF="${GITHUB_REF#refs/heads/}"
|
||||||
echo "tag=${TAG}" >> $GITHUB_OUTPUT
|
if [ -z "$REF" ]; then exit 1; fi
|
||||||
|
|
||||||
|
VER="$(git describe --tags 2>/dev/null)"
|
||||||
|
echo "version=${VER}" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
echo 'tags<<EOF' >> "$GITHUB_OUTPUT"
|
||||||
|
if [[ "$REF" == "main" ]]; then
|
||||||
|
echo "${IMAGE}:latest" >> "$GITHUB_OUTPUT"
|
||||||
|
else
|
||||||
|
echo "${IMAGE}:branch-${REF}" >> "$GITHUB_OUTPUT"
|
||||||
|
fi
|
||||||
|
echo 'EOF' >> "$GITHUB_OUTPUT"
|
||||||
- uses: docker/build-push-action@v4
|
- uses: docker/build-push-action@v4
|
||||||
with:
|
with:
|
||||||
push: true
|
push: true
|
||||||
tags: |
|
tags: ${{ steps.info.outputs.tags }}
|
||||||
ghcr.io/postalserver/postal:${{ steps.tag.outputs.tag }}
|
|
||||||
cache-from: type=gha
|
cache-from: type=gha
|
||||||
cache-to: type=gha,mode=max
|
cache-to: type=gha,mode=max
|
||||||
target: full
|
target: full
|
||||||
platforms: linux/amd64
|
platforms: linux/amd64
|
||||||
|
build-args: |
|
||||||
|
VERSION=${{ steps.info.outputs.version }}
|
||||||
|
|
||||||
publish-image:
|
publish-image:
|
||||||
name: Publish Image
|
name: Publish Image
|
||||||
|
|||||||
المرجع في مشكلة جديدة
حظر مستخدم