26 lines
948 B
YAML
26 lines
948 B
YAML
name: build
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Build & push iloom-frontend
|
|
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-flatten.git" "$workdir"
|
|
cd "$workdir"; git checkout "${{ github.sha }}"
|
|
echo "${{ secrets.REGISTRY_TOKEN }}" | docker login localhost:3000 -u kaezhou --password-stdin
|
|
docker build --build-arg BASE_REGISTRY=docker.io/library/ \
|
|
-t "$REG/iloom-frontend:$TAG" -t "$REG/iloom-frontend:latest" .
|
|
docker push "$REG/iloom-frontend:$TAG"
|
|
docker push "$REG/iloom-frontend:latest"
|
|
rm -rf "$workdir"
|
|
echo "done: iloom-frontend pushed at $TAG + latest"
|