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:
|
matrix:
|
||||||
image: ${{ fromJson(needs.detect-changes.outputs.matrix) }}
|
image: ${{ fromJson(needs.detect-changes.outputs.matrix) }}
|
||||||
steps:
|
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
|
- name: Checkout repository
|
||||||
run: |
|
run: |
|
||||||
git clone --depth 1 https://gitea.arnodo.fr/${{ gitea.repository }}.git /workspace
|
# Use $HOME to avoid /workspace conflicts
|
||||||
cd /workspace
|
WORK_DIR="$HOME/build"
|
||||||
git checkout ${{ gitea.sha }} || true
|
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
|
- name: Build and push with Buildkit
|
||||||
env:
|
env:
|
||||||
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
|
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
|
||||||
REGISTRY_USER: ${{ gitea.actor }}
|
REGISTRY_USER: ${{ gitea.actor }}
|
||||||
run: |
|
run: |
|
||||||
cd /workspace
|
cd "$WORK_DIR"
|
||||||
IMAGE_NAME="${{ env.REGISTRY }}/damien/${{ matrix.image }}"
|
IMAGE_NAME="${{ env.REGISTRY }}/damien/${{ matrix.image }}"
|
||||||
SHORT_SHA=$(echo "${{ gitea.sha }}" | cut -c1-7)
|
SHORT_SHA=$(echo "${{ gitea.sha }}" | cut -c1-7)
|
||||||
|
|
||||||
@@ -108,6 +108,8 @@ jobs:
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
echo "Building ${IMAGE_NAME}..."
|
echo "Building ${IMAGE_NAME}..."
|
||||||
|
echo "Context: ./images/${{ matrix.image }}"
|
||||||
|
ls -la ./images/${{ matrix.image }}/
|
||||||
|
|
||||||
# Build and push with buildctl
|
# Build and push with buildctl
|
||||||
buildctl-daemonless.sh build \
|
buildctl-daemonless.sh build \
|
||||||
|
|||||||
Reference in New Issue
Block a user