fix: replace actions/checkout with manual git clone (no Node dependency)
This commit is contained in:
@@ -29,9 +29,10 @@ jobs:
|
||||
- name: Install dependencies
|
||||
run: apk add --no-cache git jq
|
||||
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 2
|
||||
- name: Checkout repository
|
||||
run: |
|
||||
git clone --depth 2 https://gitea.arnodo.fr/${{ gitea.repository }}.git .
|
||||
git checkout ${{ gitea.sha }}
|
||||
|
||||
- name: Detect changed images
|
||||
id: changes
|
||||
@@ -72,19 +73,30 @@ jobs:
|
||||
matrix:
|
||||
image: ${{ fromJson(needs.detect-changes.outputs.matrix) }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- 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
|
||||
|
||||
- name: Build and push with Buildkit
|
||||
env:
|
||||
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
|
||||
REGISTRY_USER: ${{ gitea.actor }}
|
||||
run: |
|
||||
cd /workspace
|
||||
IMAGE_NAME="${{ env.REGISTRY }}/damien/${{ matrix.image }}"
|
||||
SHORT_SHA=$(echo "${{ gitea.sha }}" | cut -c1-7)
|
||||
|
||||
# Create auth config for registry
|
||||
mkdir -p ~/.docker
|
||||
AUTH=$(echo -n "${REGISTRY_USER}:${REGISTRY_TOKEN}" | base64)
|
||||
AUTH=$(echo -n "${REGISTRY_USER}:${REGISTRY_TOKEN}" | base64 | tr -d '\n')
|
||||
cat > ~/.docker/config.json <<EOF
|
||||
{
|
||||
"auths": {
|
||||
@@ -95,6 +107,8 @@ jobs:
|
||||
}
|
||||
EOF
|
||||
|
||||
echo "Building ${IMAGE_NAME}..."
|
||||
|
||||
# Build and push with buildctl
|
||||
buildctl-daemonless.sh build \
|
||||
--frontend dockerfile.v0 \
|
||||
|
||||
Reference in New Issue
Block a user