This commit is contained in:
@@ -6,35 +6,38 @@ on:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
build docker:
|
||||
runs-on: linux_amd
|
||||
# No space in the job id: it is interpolated verbatim into the podman network
|
||||
# name, and podman rejects [a-zA-Z0-9][a-zA-Z0-9_.-]* violations that docker let through.
|
||||
build-docker:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
IMAGE: git.d3vyce.fr/${{ github.repository }}:latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v7
|
||||
# actions/checkout#1830
|
||||
# with:
|
||||
# lfs: 'true'
|
||||
- name: Checkout LFS
|
||||
run: |
|
||||
function EscapeForwardSlash() { echo "$1" | sed 's/\//\\\//g'; }
|
||||
readonly ReplaceStr="EscapeForwardSlash ${{ gitea.repository }}.git/info/lfs/objects/batch"; sed -i "s/\(\[http\)\( \".*\)\"\]/\1\2`$ReplaceStr`\"]/" .git/config
|
||||
git config --local lfs.transfer.maxretries 1
|
||||
/usr/bin/git lfs fetch origin refs/remotes/origin/${{ gitea.ref_name }}
|
||||
/usr/bin/git lfs checkout
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
- name: Login to Docker registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: git.d3vyce.fr
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GIT_TOKEN }}
|
||||
- name: Verify LFS objects resolved
|
||||
run: |
|
||||
# A failed fetch leaves pointer files behind and hugo only dies later on
|
||||
# .Resize with "image: unknown format". Fail here, where the cause is legible.
|
||||
if git lfs ls-files | awk '$2 == "-"' | grep -q .; then
|
||||
echo "::error::LFS objects missing - these are still pointer files:"
|
||||
git lfs ls-files | awk '$2 == "-" { print " " $3 }'
|
||||
exit 1
|
||||
fi
|
||||
- name: Install buildah
|
||||
run: |
|
||||
apt-get update && apt-get install -y buildah
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
platforms: linux/amd64
|
||||
push: true
|
||||
tags: git.d3vyce.fr/${{ github.repository }}:latest
|
||||
run: |
|
||||
buildah login -u "${{ github.actor }}" -p "${{ secrets.GIT_TOKEN }}" git.d3vyce.fr
|
||||
buildah --storage-driver vfs build --isolation chroot -t "$IMAGE" -f ./Dockerfile .
|
||||
buildah --storage-driver vfs push "$IMAGE"
|
||||
|
||||
Reference in New Issue
Block a user