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:
|
with:
|
||||||
go-version: "1.22"
|
go-version: "1.22"
|
||||||
cache: true
|
cache: true
|
||||||
cache-dependency-path: |
|
cache-dependency-path: backend/chat/go.sum
|
||||||
backend/playout/go.sum
|
|
||||||
backend/chat/go.sum
|
|
||||||
|
|
||||||
- name: Validate Playlist Normalization
|
- name: Download Go modules
|
||||||
run: cd backend/playout && go run src/playlist.go playlist.txt || echo "Validation script not yet complete"
|
run: cd backend/chat && go mod download
|
||||||
|
|
||||||
- name: Build Docker Images
|
|
||||||
run: docker compose build --no-cache
|
|
||||||
|
|
||||||
- name: Run Tests
|
- name: Run Tests
|
||||||
run: echo "Tests will be added in future CI steps (per TODO.md)"
|
run: echo "Tests will be added in future CI steps (per TODO.md)"
|
||||||
@@ -89,6 +84,8 @@ jobs:
|
|||||||
push: true
|
push: true
|
||||||
tags: ${{ steps.meta-playout.outputs.tags }}
|
tags: ${{ steps.meta-playout.outputs.tags }}
|
||||||
labels: ${{ steps.meta-playout.outputs.labels }}
|
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
|
- name: Extract metadata for Chat
|
||||||
id: meta-chat
|
id: meta-chat
|
||||||
@@ -109,6 +106,8 @@ jobs:
|
|||||||
push: true
|
push: true
|
||||||
tags: ${{ steps.meta-chat.outputs.tags }}
|
tags: ${{ steps.meta-chat.outputs.tags }}
|
||||||
labels: ${{ steps.meta-chat.outputs.labels }}
|
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
|
- name: Extract metadata for Nginx
|
||||||
id: meta-nginx
|
id: meta-nginx
|
||||||
@@ -123,23 +122,15 @@ jobs:
|
|||||||
type=raw,value=latest,enable={{is_default_branch}}
|
type=raw,value=latest,enable={{is_default_branch}}
|
||||||
|
|
||||||
- name: Build and push Nginx image
|
- name: Build and push Nginx image
|
||||||
run: |
|
uses: docker/build-push-action@v5
|
||||||
TAGS="${{ steps.meta-nginx.outputs.tags }}"
|
with:
|
||||||
LABELS="${{ steps.meta-nginx.outputs.labels }}"
|
context: .
|
||||||
TAG_ARGS=""
|
file: infrastructure/nginx/Dockerfile
|
||||||
for tag in $TAGS; do
|
push: true
|
||||||
TAG_ARGS="$TAG_ARGS --tag $tag"
|
tags: ${{ steps.meta-nginx.outputs.tags }}
|
||||||
done
|
labels: ${{ steps.meta-nginx.outputs.labels }}
|
||||||
LABEL_ARGS=""
|
cache-from: type=registry,ref=git.allucanget.biz/zwitschi/linearvoid/buildcache:nginx
|
||||||
while IFS= read -r label; do
|
cache-to: type=registry,ref=git.allucanget.biz/zwitschi/linearvoid/buildcache:nginx,mode=max
|
||||||
[ -n "$label" ] && LABEL_ARGS="$LABEL_ARGS --label $label"
|
|
||||||
done <<< "$LABELS"
|
|
||||||
docker buildx build \
|
|
||||||
--push \
|
|
||||||
--file infrastructure/nginx/Dockerfile \
|
|
||||||
$TAG_ARGS \
|
|
||||||
$LABEL_ARGS \
|
|
||||||
.
|
|
||||||
|
|
||||||
release:
|
release:
|
||||||
needs: docker
|
needs: docker
|
||||||
|
|||||||
@@ -71,6 +71,8 @@ jobs:
|
|||||||
push: true
|
push: true
|
||||||
tags: ${{ steps.meta-playout.outputs.tags }}
|
tags: ${{ steps.meta-playout.outputs.tags }}
|
||||||
labels: ${{ steps.meta-playout.outputs.labels }}
|
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
|
- name: Extract metadata for Chat
|
||||||
id: meta-chat
|
id: meta-chat
|
||||||
@@ -89,6 +91,8 @@ jobs:
|
|||||||
push: true
|
push: true
|
||||||
tags: ${{ steps.meta-chat.outputs.tags }}
|
tags: ${{ steps.meta-chat.outputs.tags }}
|
||||||
labels: ${{ steps.meta-chat.outputs.labels }}
|
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
|
- name: Extract metadata for Nginx
|
||||||
id: meta-nginx
|
id: meta-nginx
|
||||||
@@ -108,6 +112,8 @@ jobs:
|
|||||||
push: true
|
push: true
|
||||||
tags: ${{ steps.meta-nginx.outputs.tags }}
|
tags: ${{ steps.meta-nginx.outputs.tags }}
|
||||||
labels: ${{ steps.meta-nginx.outputs.labels }}
|
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
|
||||||
|
|
||||||
- name: Create Release on Gitea
|
- name: Create Release on Gitea
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
Reference in new issue
Block a user