This commit is contained in:
Julius Zeidler 2025-04-07 15:38:08 +02:00
parent 73bd33ea28
commit 416988c214

View file

@ -13,39 +13,56 @@ env:
# Set this to the public IP or hostname of your registry, # Set this to the public IP or hostname of your registry,
# whichever you use to reach it from your desktop/laptop # whichever you use to reach it from your desktop/laptop
FORGEJO_HOST: code.zeidler.dev FORGEJO_HOST: code.zeidler.dev
jobs:
build-and-push:
runs-on: catthehacker
environment: deploy
steps:
- name: Prepare environment variables
run: |
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
echo REGISTRY=${{ env.FORGEJO_HOST }} >> $GITHUB_ENV
- name: Checkout the repo
uses: actions/checkout@v4
- name: Login to the registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.PACKAGE_TOKEN }}
build: build:
runs-on: catthehacker runs-on: docker
environment: deploy container:
image: catthehacker/ubuntu:act-latest
steps: steps:
- name: Set up Docker Buildx - name: Wait for Docker daemon
uses: docker/setup-buildx-action@v3 run: |
with: timeout=300 # Set a timeout value in seconds
driver: docker-container until docker info; do
- name: Build and push echo "Waiting for Docker daemon to start..."
uses: docker/build-push-action@v6 sleep 5
with: timeout=$((timeout-5))
context: context if [ $timeout -le 0 ]; then
push: true echo "Timeout waiting for Docker daemon to start."
provenance: false exit 1
platforms: linux/amd64, linux/arm64 fi
tags: ${{ env.REGISTRY }}/${{ github.actor }}/${{ env.CONTAINER_NAME }}:latest done
# jobs:
# build-and-push:
# runs-on: catthehacker
# environment: deploy
# steps:
# - name: Prepare environment variables
# run: |
# echo "$HOME/.local/bin" >> "$GITHUB_PATH"
# echo REGISTRY=${{ env.FORGEJO_HOST }} >> $GITHUB_ENV
#
# - name: Checkout the repo
# uses: actions/checkout@v4
#
# - name: Login to the registry
# uses: docker/login-action@v3
# with:
# registry: ${{ env.REGISTRY }}
# username: ${{ github.actor }}
# password: ${{ secrets.PACKAGE_TOKEN }}
# build:
# runs-on: catthehacker
# environment: deploy
# steps:
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v3
# with:
# driver: docker-container
# - name: Build and push
# uses: docker/build-push-action@v6
# with:
# context: context
# push: true
# provenance: false
# platforms: linux/amd64, linux/arm64
# tags: ${{ env.REGISTRY }}/${{ github.actor }}/${{ env.CONTAINER_NAME }}:latest