fix workflow
This commit is contained in:
parent
1dbbbc840d
commit
50cfa9da4e
1 changed files with 48 additions and 29 deletions
|
|
@ -1,45 +1,64 @@
|
||||||
name: Build and push Docker images
|
name: Build images
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- master
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
|
env:
|
||||||
|
# Set this to the public IP or hostname of your registry,
|
||||||
|
# whichever you use to reach it from your desktop/laptop
|
||||||
|
FORGEJO_HOST: code.zeidler.dev
|
||||||
|
HELM_EXPERIMENTAL_OCI: 1
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
check-docker:
|
||||||
runs-on: ubuntu-latest
|
runs-on: docker-cli
|
||||||
strategy:
|
services:
|
||||||
fail-fast: false
|
docker:
|
||||||
matrix:
|
image: registry.zeidler.dev/docker-hub/catthehacker/ubuntu:act-latest
|
||||||
include:
|
options: --privileged
|
||||||
- service: claude
|
container:
|
||||||
context: ./claude
|
image: registry.zeidler.dev/docker-hub/catthehacker/ubuntu:act-latest
|
||||||
- service: proxy
|
|
||||||
context: ./proxy
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Wait for Docker daemon
|
||||||
|
run: |
|
||||||
|
timeout=300 # Set a timeout value in seconds
|
||||||
|
until docker info; do
|
||||||
|
echo "Waiting for Docker daemon to start..."
|
||||||
|
sleep 5
|
||||||
|
timeout=$((timeout-5))
|
||||||
|
if [ $timeout -le 0 ]; then
|
||||||
|
echo "Timeout waiting for Docker daemon to start."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
build-and-push:
|
||||||
|
runs-on: docker-cli
|
||||||
|
services:
|
||||||
|
docker:
|
||||||
|
image: registry.zeidler.dev/docker-hub/catthehacker/ubuntu:act-latest
|
||||||
|
options: --privileged
|
||||||
|
environment: deploy
|
||||||
|
container:
|
||||||
|
image: registry.zeidler.dev/docker-hub/catthehacker/ubuntu:act-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout the repo
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
- name: Login to the registry
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
|
|
||||||
- name: Log in to ${{ vars.REGISTRY_URL }}
|
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: ${{ vars.REGISTRY_URL }}
|
registry: ${{ vars.REGISTRY_URL }}
|
||||||
username: ${{ vars.REGISTRY_USER }}
|
username: ${{ vars.REGISTRY_USER }}
|
||||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||||
|
- name: Set up Docker Buildx
|
||||||
- name: Build and push ${{ matrix.service }}
|
uses: docker/setup-buildx-action@v3
|
||||||
uses: docker/build-push-action@v5
|
|
||||||
with:
|
with:
|
||||||
context: ${{ matrix.context }}
|
driver: docker-container
|
||||||
|
- name: Docker publish
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
push: true
|
push: true
|
||||||
tags: |
|
platforms: linux/amd64, linux/arm64
|
||||||
${{ vars.REGISTRY_URL }}/${{ vars.REGISTRY_USER }}/${{ matrix.service }}:latest
|
tags: ${{ vars.REGISTRY_URL }}/docker/${{ env.GITHUB_REPOSITORY }}:0.1.${{ env.GITHUB_RUN_NUMBER }}
|
||||||
${{ vars.REGISTRY_URL }}/${{ vars.REGISTRY_USER }}/${{ matrix.service }}:${{ github.sha }}
|
|
||||||
cache-from: type=registry,ref=${{ vars.REGISTRY_URL }}/${{ vars.REGISTRY_USER }}/${{ matrix.service }}:cache
|
|
||||||
cache-to: type=registry,ref=${{ vars.REGISTRY_URL }}/${{ vars.REGISTRY_USER }}/${{ matrix.service }}:cache,mode=max
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue