Update .gitea/workflows/ci.yml
All checks were successful
CI - Build Tonehaus Docker image / tonehaus-ci-build (push) Successful in 2m1s
All checks were successful
CI - Build Tonehaus Docker image / tonehaus-ci-build (push) Successful in 2m1s
This commit is contained in:
@@ -10,10 +10,10 @@ env:
|
|||||||
IMAGE_NAME: tonehaus
|
IMAGE_NAME: tonehaus
|
||||||
DOCKERFILE: docker/php/Dockerfile
|
DOCKERFILE: docker/php/Dockerfile
|
||||||
BUILD_TARGET: prod
|
BUILD_TARGET: prod
|
||||||
PLATFORMS: linux/amd64,linux/arm64
|
PLATFORMS: linux/amd64
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
tonehaus-ci-build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -38,28 +38,46 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
echo "$REGISTRY_PASSWORD" | docker login "$REGISTRY" -u "$REGISTRY_USERNAME" --password-stdin
|
echo "$REGISTRY_PASSWORD" | docker login "$REGISTRY" -u "$REGISTRY_USERNAME" --password-stdin
|
||||||
|
|
||||||
- name: Build single-arch images for artifacts (no registry)
|
- name: Docker Build
|
||||||
if: ${{ env.REGISTRY == '' }}
|
if: ${{ env.REGISTRY != '' && env.REGISTRY_IMAGE != '' }}
|
||||||
|
env:
|
||||||
|
REGISTRY: ${{ secrets.REGISTRY }}
|
||||||
|
REGISTRY_IMAGE: ${{ secrets.REGISTRY_IMAGE }}
|
||||||
run: |
|
run: |
|
||||||
TAG_SHA=${{ steps.meta.outputs.short_sha }}
|
TAG_SHA=${{ steps.meta.outputs.short_sha }}
|
||||||
for P in linux/amd64; do \
|
|
||||||
ARCH=${P#linux/}; \
|
|
||||||
docker buildx build \
|
docker buildx build \
|
||||||
--platform "$P" \
|
--platform "$PLATFORMS" \
|
||||||
--file "$DOCKERFILE" \
|
--file "$DOCKERFILE" \
|
||||||
--target "$BUILD_TARGET" \
|
--target "$BUILD_TARGET" \
|
||||||
--build-arg APP_ENV=prod \
|
--build-arg APP_ENV=prod \
|
||||||
--output type=docker \
|
--tag "$REGISTRY/$REGISTRY_IMAGE:$TAG_SHA" \
|
||||||
--tag "$IMAGE_NAME:$TAG_SHA-$ARCH" \
|
--tag "$REGISTRY/$REGISTRY_IMAGE:ci" \
|
||||||
. ; \
|
--push \
|
||||||
docker save "$IMAGE_NAME:$TAG_SHA-$ARCH" -o "tonehaus-image-$ARCH.tar" ; \
|
.
|
||||||
done
|
|
||||||
|
|
||||||
- name: Upload artifacts
|
# - name: Build single-arch images for artifacts (no registry)
|
||||||
if: ${{ env.REGISTRY == '' }}
|
# if: ${{ env.REGISTRY == '' }}
|
||||||
uses: actions/upload-artifact@v4
|
# run: |
|
||||||
with:
|
# TAG_SHA=${{ steps.meta.outputs.short_sha }}
|
||||||
name: tonehaus-images
|
# for P in $PLATFORMS; do \
|
||||||
path: |
|
# ARCH=${P#linux/}; \
|
||||||
tonehaus-image-amd64.tar
|
# docker buildx build \
|
||||||
|
# --platform "$P" \
|
||||||
|
# --file "$DOCKERFILE" \
|
||||||
|
# --target "$BUILD_TARGET" \
|
||||||
|
# --build-arg APP_ENV=prod \
|
||||||
|
# --output type=docker \
|
||||||
|
# --tag "$IMAGE_NAME:$TAG_SHA-$ARCH" \
|
||||||
|
# . ; \
|
||||||
|
# docker save "$IMAGE_NAME:$TAG_SHA-$ARCH" -o "tonehaus-image-$ARCH.tar" ; \
|
||||||
|
# done
|
||||||
|
|
||||||
|
## Artifacts not configured yet..
|
||||||
|
# - name: Upload artifacts
|
||||||
|
# if: ${{ env.REGISTRY == '' }}
|
||||||
|
# uses: actions/upload-artifact@v4
|
||||||
|
# with:
|
||||||
|
# name: tonehaus-images
|
||||||
|
# path: |
|
||||||
|
# tonehaus-image-amd64.tar
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user