feat: CI pipeline improvements
- remove image build duplication - update workflows to use caching
This commit is contained in:
1 parent
68ba3a25b9
commit
51f3e98816
2 files changed
+22
-25
No files matched your search
+16
-25
@@ -36,15 +36,10 @@ jobs:
|
||||
with:
|
||||
go-version: "1.22"
|
||||
cache: true
|
||||
cache-dependency-path: |
|
||||
backend/playout/go.sum
|
||||
backend/chat/go.sum
|
||||
cache-dependency-path: backend/chat/go.sum
|
||||
|
||||
- name: Validate Playlist Normalization
|
||||
run: cd backend/playout && go run src/playlist.go playlist.txt || echo "Validation script not yet complete"
|
||||
|
||||
- name: Build Docker Images
|
||||
run: docker compose build --no-cache
|
||||
- name: Download Go modules
|
||||
run: cd backend/chat && go mod download
|
||||
|
||||
- name: Run Tests
|
||||
run: echo "Tests will be added in future CI steps (per TODO.md)"
|
||||
@@ -89,6 +84,8 @@ jobs:
|
||||
push: true
|
||||
tags: ${{ steps.meta-playout.outputs.tags }}
|
||||
labels: ${{ steps.meta-playout.outputs.labels }}
|
||||
cache-from: type=registry,ref=git.allucanget.biz/zwitschi/linearvoid/buildcache:playout
|
||||
cache-to: type=registry,ref=git.allucanget.biz/zwitschi/linearvoid/buildcache:playout,mode=max
|
||||
|
||||
- name: Extract metadata for Chat
|
||||
id: meta-chat
|
||||
@@ -109,6 +106,8 @@ jobs:
|
||||
push: true
|
||||
tags: ${{ steps.meta-chat.outputs.tags }}
|
||||
labels: ${{ steps.meta-chat.outputs.labels }}
|
||||
cache-from: type=registry,ref=git.allucanget.biz/zwitschi/linearvoid/buildcache:chat
|
||||
cache-to: type=registry,ref=git.allucanget.biz/zwitschi/linearvoid/buildcache:chat,mode=max
|
||||
|
||||
- name: Extract metadata for Nginx
|
||||
id: meta-nginx
|
||||
@@ -123,23 +122,15 @@ jobs:
|
||||
type=raw,value=latest,enable={{is_default_branch}}
|
||||
|
||||
- name: Build and push Nginx image
|
||||
run: |
|
||||
TAGS="${{ steps.meta-nginx.outputs.tags }}"
|
||||
LABELS="${{ steps.meta-nginx.outputs.labels }}"
|
||||
TAG_ARGS=""
|
||||
for tag in $TAGS; do
|
||||
TAG_ARGS="$TAG_ARGS --tag $tag"
|
||||
done
|
||||
LABEL_ARGS=""
|
||||
while IFS= read -r label; do
|
||||
[ -n "$label" ] && LABEL_ARGS="$LABEL_ARGS --label $label"
|
||||
done <<< "$LABELS"
|
||||
docker buildx build \
|
||||
--push \
|
||||
--file infrastructure/nginx/Dockerfile \
|
||||
$TAG_ARGS \
|
||||
$LABEL_ARGS \
|
||||
.
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
file: infrastructure/nginx/Dockerfile
|
||||
push: true
|
||||
tags: ${{ steps.meta-nginx.outputs.tags }}
|
||||
labels: ${{ steps.meta-nginx.outputs.labels }}
|
||||
cache-from: type=registry,ref=git.allucanget.biz/zwitschi/linearvoid/buildcache:nginx
|
||||
cache-to: type=registry,ref=git.allucanget.biz/zwitschi/linearvoid/buildcache:nginx,mode=max
|
||||
|
||||
release:
|
||||
needs: docker
|
||||
|
||||
Reference in new issue
Block a user