Build action
This commit is contained in:
@@ -0,0 +1,50 @@
|
|||||||
|
name: build
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main] # ← PODMIEŃ na swoją gałąź
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Login do rejestru
|
||||||
|
run: echo "${{ secrets.REGISTRY_TOKEN }}" | docker login gitea.czernobog.pl -u gitea --password-stdin
|
||||||
|
|
||||||
|
# Lekkie obrazy k3s-owe — budowane zawsze
|
||||||
|
- name: Build k3s images (librarian, bot)
|
||||||
|
run: |
|
||||||
|
TAG=${GITHUB_SHA::8}
|
||||||
|
docker build -f docker/Dockerfile.librarian -t gitea.czernobog.pl/gitea/conjurer-librarian:$TAG .
|
||||||
|
docker push gitea.czernobog.pl/gitea/conjurer-librarian:$TAG
|
||||||
|
docker build -f docker/Dockerfile.bot -t gitea.czernobog.pl/gitea/conjurer-bot:$TAG .
|
||||||
|
docker push gitea.czernobog.pl/gitea/conjurer-bot:$TAG
|
||||||
|
|
||||||
|
# Docker-owe: musician i share lekkie, radio CIĘŻKIE (opam+OCaml+liquidsoap)
|
||||||
|
- name: Build docker-stack images (musician, share)
|
||||||
|
run: |
|
||||||
|
TAG=${GITHUB_SHA::8}
|
||||||
|
docker build -f docker/Dockerfile.musician -t gitea.czernobog.pl/gitea/conjurer-musician:$TAG .
|
||||||
|
docker push gitea.czernobog.pl/gitea/conjurer-musician:$TAG
|
||||||
|
docker build -f docker/Dockerfile.share -t gitea.czernobog.pl/gitea/conjurer-share:$TAG .
|
||||||
|
docker push gitea.czernobog.pl/gitea/conjurer-share:$TAG
|
||||||
|
|
||||||
|
# RADIO: budowane TYLKO gdy zmieniło się coś istotnego (oszczędza ~15 min na push)
|
||||||
|
- name: Czy radio wymaga rebuildu?
|
||||||
|
id: radio_changed
|
||||||
|
run: |
|
||||||
|
if git diff --name-only HEAD~1 HEAD | grep -qE "docker/Dockerfile.radio|docker/entrypoint.radio.sh|docker/icecast.xml.tpl|docker/pulse-system.pa|conjurer_musician/radio_conjurer.liq|conjurer_betoniarka/"; then
|
||||||
|
echo "build=yes" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
echo "build=no" >> $GITHUB_OUTPUT
|
||||||
|
echo "radio bez zmian — pomijam ciężki build"
|
||||||
|
fi
|
||||||
|
- name: Build radio
|
||||||
|
if: steps.radio_changed.outputs.build == 'yes'
|
||||||
|
run: |
|
||||||
|
TAG=${GITHUB_SHA::8}
|
||||||
|
docker build -f docker/Dockerfile.radio -t gitea.czernobog.pl/gitea/conjurer-radio:$TAG .
|
||||||
|
docker push gitea.czernobog.pl/gitea/conjurer-radio:$TAG
|
||||||
|
|
||||||
|
- name: Podsumowanie
|
||||||
|
run: echo "Zbudowano tag ${GITHUB_SHA::8}"
|
||||||
Reference in New Issue
Block a user