This commit is contained in:
parent
028bb6cc0e
commit
b05ae9d889
35
.gitea/workflows/build.yml
Normal file
35
.gitea/workflows/build.yml
Normal file
@ -0,0 +1,35 @@
|
||||
name: build
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Build & push iloom services
|
||||
run: |
|
||||
set -eo pipefail
|
||||
REG=localhost:3000/kaezhou
|
||||
TAG=dev-$(echo "${{ github.sha }}" | cut -c1-8)
|
||||
workdir=$(mktemp -d)
|
||||
git clone "http://kaezhou:${{ secrets.REGISTRY_TOKEN }}@localhost:3000/kaezhou/iloom.git" "$workdir"
|
||||
cd "$workdir"; git checkout "${{ github.sha }}"
|
||||
echo "${{ secrets.REGISTRY_TOKEN }}" | docker login localhost:3000 -u kaezhou --password-stdin
|
||||
for pair in \
|
||||
"iloom-gateway:gateway/Dockerfile" \
|
||||
"iloom-auth-service:auth-service/Dockerfile" \
|
||||
"iloom-purchaser-service:purchaser-service/Dockerfile" \
|
||||
"iloom-textile-service:textile-service/Dockerfile" \
|
||||
"iloom-washing-service:washing-service/Dockerfile"; do
|
||||
name="${pair%%:*}"; df="${pair##*:}"
|
||||
echo "::group::build $name ($df)"
|
||||
docker build --build-arg BASE_REGISTRY= -f "$df" \
|
||||
-t "$REG/$name:$TAG" -t "$REG/$name:latest" .
|
||||
docker push "$REG/$name:$TAG"
|
||||
docker push "$REG/$name:latest"
|
||||
echo "::endgroup::"
|
||||
done
|
||||
rm -rf "$workdir"
|
||||
echo "done: 5 iloom images pushed at $TAG + latest"
|
||||
Loading…
x
Reference in New Issue
Block a user