Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
cdrage committed Jun 23, 2024
1 parent dd830bd commit f6c0517
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Push & build images on each commit

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:

build:

runs-on: ubuntu-latest
environment: registry

steps:
- uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Log in
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}

- name: Build and push images
run: |
ls -lah
for dir in */; do
repo_name=$(basename "$dir")
if [[ "$repo_name" == bootc-* ]]; then
echo "Skipping $repo_name: Ignored by pattern"
continue
fi
if [ -d "$dir" ]; then
if [ -f "$dir/Containerfile" ]; then
echo "Building and pushing $repo_name"
cd $dir
docker buildx build --platform linux/amd64,linux/arm64 \
-t ghcr.io/${{ secrets.REGISTRY_USERNAME }}/${repo_name} \
--push -f Containerfile .
cd ..
else
echo "Skipping $repo_name: No Containerfile found"
fi
else
echo "Skipping $dir: Not a directory"
fi
done

0 comments on commit f6c0517

Please sign in to comment.