This commit is contained in:
@@ -9,42 +9,22 @@ on:
|
||||
jobs:
|
||||
build-and-push:
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
docker:
|
||||
image: docker:dind
|
||||
env:
|
||||
DOCKER_TLS_CERTDIR: ""
|
||||
options: --privileged
|
||||
env:
|
||||
DOCKER_HOST: tcp://docker:2375
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Wait for Docker
|
||||
run: |
|
||||
until docker info; do
|
||||
echo "Waiting for Docker daemon..."
|
||||
sleep 2
|
||||
done
|
||||
|
||||
- name: Log in to Docker Hub
|
||||
run: echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login -u "${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
run: docker buildx create --use --driver docker-container --name multiarch
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Build and push each container
|
||||
run: |
|
||||
for dir in */; do
|
||||
dir="${dir%/}"
|
||||
if [ -f "$dir/Dockerfile" ]; then
|
||||
echo "Building $dir..."
|
||||
docker buildx build \
|
||||
--platform linux/amd64,linux/arm64 \
|
||||
--tag ${{ secrets.DOCKERHUB_USERNAME }}/${dir}:latest \
|
||||
--tag ${{ secrets.DOCKERHUB_USERNAME }}/${dir}:${{ github.sha }} \
|
||||
--push \
|
||||
"$dir"
|
||||
fi
|
||||
done
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: pandoc-pdf
|
||||
push: true
|
||||
tags: clbx/pandoc-pdf:latest
|
||||
|
||||
Reference in New Issue
Block a user