Skip to content

Commit

Permalink
Adding workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
mahomedalid committed Oct 19, 2023
1 parent ef3a64b commit 0c82ec9
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/release-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Build and Publish Docker Images

on:
push:
branches:
- main

jobs:
build_and_publish:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

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

- name: Login to GitHub Container Registry
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin

- name: Build and Publish Docker Images
run: |
for dir in */; do
dir=${dir%*/}
image_name=$(echo $dir | tr '[:upper:]' '[:lower:]' | tr -d '[:space:]')
tag=${{ github.sha }}
docker buildx build -t ghcr.io/${{ github.repository }}/$$image_name:$$tag -f ./$dir -o type=registry,registry.insecure=true
done
env:
BUILDKIT_INLINE_CACHE: 1

0 comments on commit 0c82ec9

Please sign in to comment.