From f21ee8c4ed454062fc864690376f5407202911ec Mon Sep 17 00:00:00 2001 From: "Nikolai X. Shadeuxs" Date: Sun, 23 Jun 2024 20:55:35 -0400 Subject: [PATCH] Update .gitea/workflows/main.yml --- .gitea/workflows/main.yml | 46 +++++++++++++++++++++++++++++---------- 1 file changed, 34 insertions(+), 12 deletions(-) diff --git a/.gitea/workflows/main.yml b/.gitea/workflows/main.yml index 2bc0d95..ef31a8a 100644 --- a/.gitea/workflows/main.yml +++ b/.gitea/workflows/main.yml @@ -24,29 +24,51 @@ jobs: username: ${{ secrets.DOCKERHUB_USER }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Extract metadata + - name: Extract metadata for API uses: docker/metadata-action@v5 - id: meta + id: meta-api with: images: vontainment/v-firecrawl flavor: latest=false tags: | - type=raw,value=main,enable=${{ github.ref == 'refs/heads/main' }} - type=raw,value=dev,enable=${{ github.ref == 'refs/heads/dev' }} - type=sha,priority=100,enable=${{ github.event_name == 'push' }} + type=raw,value=main,enable=${{ gitea.ref == 'refs/heads/main' }} + type=raw,value=dev,enable=${{ gitea.ref == 'refs/heads/dev' }} + type=sha,priority=100,enable=${{ gitea.event_name == 'push' }} - - name: Build and push Docker image + - name: Extract metadata for Playwright Service + uses: docker/metadata-action@v5 + id: meta-playwright + with: + images: vontainment/v-playwright + flavor: latest=false + tags: | + type=raw,value=main,enable=${{ gitea.ref == 'refs/heads/main' }} + type=raw,value=dev,enable=${{ gitea.ref == 'refs/heads/dev' }} + type=sha,priority=100,enable=${{ gitea.event_name == 'push' }} + + - name: Build and push Docker image (API) uses: docker/build-push-action@v5 with: context: ./apps/api file: ./apps/api/Dockerfile push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - cache-from: type=local,src=/opt/hostedtoolcache/${{ github.repository }}-${{ github.ref_name }}/build/ - cache-to: type=local,dest=/opt/hostedtoolcache/${{ github.repository }}-${{ github.ref_name }}/build-new/ + tags: ${{ steps.meta-api.outputs.tags }} + labels: ${{ steps.meta-api.outputs.labels }} + cache-from: type=local,src=/opt/hostedtoolcache/${{ gitea.repository }}-${{ gitea.ref_name }}/build/ + cache-to: type=local,dest=/opt/hostedtoolcache/${{ gitea.repository }}-${{ gitea.ref_name }}/build-new/ + + - name: Build and push Docker image (Playwright Service) + uses: docker/build-push-action@v5 + with: + context: ./apps/playwright-service + file: ./apps/playwright-service/Dockerfile + push: true + tags: ${{ steps.meta-playwright.outputs.tags }} + labels: ${{ steps.meta-playwright.outputs.labels }} + cache-from: type=local,src=/opt/hostedtoolcache/${{ gitea.repository }}-${{ gitea.ref_name }}/build/ + cache-to: type=local,dest=/opt/hostedtoolcache/${{ gitea.repository }}-${{ gitea.ref_name }}/build-new/ - name: Rotate build cache run: | - rm -rf /opt/hostedtoolcache/${{ github.repository }}-${{ github.ref_name }}/build/ - mv /opt/hostedtoolcache/${{ github.repository }}-${{ github.ref_name }}/build-new/ /opt/hostedtoolcache/${{ github.repository }}-${{ github.ref_name }}/build/ + rm -rf /opt/hostedtoolcache/${{ gitea.repository }}-${{ gitea.ref_name }}/build/ + mv /opt/hostedtoolcache/${{ gitea.repository }}-${{ gitea.ref_name }}/build-new/ /opt/hostedtoolcache/${{ gitea.repository }}-${{ gitea.ref_name }}/build/