-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (29 loc) · 1.06 KB
/
release-images.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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: |
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
for dir in */; do
dir=${dir%*/}
image_name=dapr-microservices/$(echo $dir | tr '[:upper:]' '[:lower:]' | tr -d '[:space:]')
repo_owner=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')
tag=${{ github.sha }}
tag="latest"
docker buildx build -t ghcr.io/$repo_owner/$image_name:$tag -f ./$dir/Dockerfile ./$dir -o type=registry
done
done
env:
BUILDKIT_INLINE_CACHE: 1