0

Update .gitea/workflows/main.yml
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 9m21s

This commit is contained in:
Nikolai X. Shadeuxs 2024-06-23 20:55:35 -04:00
parent 073e439cda
commit f21ee8c4ed

View File

@ -24,29 +24,51 @@ jobs:
username: ${{ secrets.DOCKERHUB_USER }} username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }} password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract metadata - name: Extract metadata for API
uses: docker/metadata-action@v5 uses: docker/metadata-action@v5
id: meta id: meta-api
with: with:
images: vontainment/v-firecrawl images: vontainment/v-firecrawl
flavor: latest=false flavor: latest=false
tags: | tags: |
type=raw,value=main,enable=${{ github.ref == 'refs/heads/main' }} type=raw,value=main,enable=${{ gitea.ref == 'refs/heads/main' }}
type=raw,value=dev,enable=${{ github.ref == 'refs/heads/dev' }} type=raw,value=dev,enable=${{ gitea.ref == 'refs/heads/dev' }}
type=sha,priority=100,enable=${{ github.event_name == 'push' }} 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 uses: docker/build-push-action@v5
with: with:
context: ./apps/api context: ./apps/api
file: ./apps/api/Dockerfile file: ./apps/api/Dockerfile
push: true push: true
tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta-api.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }} labels: ${{ steps.meta-api.outputs.labels }}
cache-from: type=local,src=/opt/hostedtoolcache/${{ github.repository }}-${{ github.ref_name }}/build/ cache-from: type=local,src=/opt/hostedtoolcache/${{ gitea.repository }}-${{ gitea.ref_name }}/build/
cache-to: type=local,dest=/opt/hostedtoolcache/${{ github.repository }}-${{ github.ref_name }}/build-new/ 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 - name: Rotate build cache
run: | run: |
rm -rf /opt/hostedtoolcache/${{ github.repository }}-${{ github.ref_name }}/build/ rm -rf /opt/hostedtoolcache/${{ gitea.repository }}-${{ gitea.ref_name }}/build/
mv /opt/hostedtoolcache/${{ github.repository }}-${{ github.ref_name }}/build-new/ /opt/hostedtoolcache/${{ github.repository }}-${{ github.ref_name }}/build/ mv /opt/hostedtoolcache/${{ gitea.repository }}-${{ gitea.ref_name }}/build-new/ /opt/hostedtoolcache/${{ gitea.repository }}-${{ gitea.ref_name }}/build/