fix: use $HOME/build instead of /workspace, remove apk install (git already in image)
This commit is contained in:
@@ -73,24 +73,24 @@ jobs:
|
||||
matrix:
|
||||
image: ${{ fromJson(needs.detect-changes.outputs.matrix) }}
|
||||
steps:
|
||||
- name: Install git
|
||||
run: |
|
||||
# buildkit image is based on Alpine
|
||||
cat /etc/os-release || true
|
||||
apk add --no-cache git || apt-get update && apt-get install -y git || true
|
||||
|
||||
- name: Checkout repository
|
||||
run: |
|
||||
git clone --depth 1 https://gitea.arnodo.fr/${{ gitea.repository }}.git /workspace
|
||||
cd /workspace
|
||||
git checkout ${{ gitea.sha }} || true
|
||||
# Use $HOME to avoid /workspace conflicts
|
||||
WORK_DIR="$HOME/build"
|
||||
rm -rf "$WORK_DIR"
|
||||
mkdir -p "$WORK_DIR"
|
||||
|
||||
# Git is included in moby/buildkit image
|
||||
git clone --depth 1 https://gitea.arnodo.fr/${{ gitea.repository }}.git "$WORK_DIR"
|
||||
|
||||
echo "WORK_DIR=$WORK_DIR" >> $GITHUB_ENV
|
||||
|
||||
- name: Build and push with Buildkit
|
||||
env:
|
||||
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
|
||||
REGISTRY_USER: ${{ gitea.actor }}
|
||||
run: |
|
||||
cd /workspace
|
||||
cd "$WORK_DIR"
|
||||
IMAGE_NAME="${{ env.REGISTRY }}/damien/${{ matrix.image }}"
|
||||
SHORT_SHA=$(echo "${{ gitea.sha }}" | cut -c1-7)
|
||||
|
||||
@@ -108,6 +108,8 @@ jobs:
|
||||
EOF
|
||||
|
||||
echo "Building ${IMAGE_NAME}..."
|
||||
echo "Context: ./images/${{ matrix.image }}"
|
||||
ls -la ./images/${{ matrix.image }}/
|
||||
|
||||
# Build and push with buildctl
|
||||
buildctl-daemonless.sh build \
|
||||
|
||||
Reference in New Issue
Block a user