diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 8a8b630..3607bda 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -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 diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index f581145..0bf6815 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -71,6 +71,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 @@ -89,6 +91,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 @@ -108,6 +112,8 @@ jobs: 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 - name: Create Release on Gitea run: |