ci: allow pushing of containers during pull requests
[buildbot.git] / .github / workflows / build-push.yml
index d87a47d844bf54fe86a041100c3cf61a2282cb42..666c9e39d6fab4dcafe6d4d11f3928485c210299 100644 (file)
@@ -8,7 +8,7 @@ on:
   pull_request:
 
 env:
-  BUILDBOT_VERSION: 3.5.0
+  BUILDBOT_VERSION: 3.8.0
 
 concurrency:
   group: ${{ github.workflow }}-${{ github.ref }}
@@ -65,12 +65,14 @@ jobs:
 
       - name: Docker meta
         id: meta
+        if: github.event_name != 'pull_request' || github.repository_owner != 'openwrt'
         uses: docker/metadata-action@v4
         with:
           images: name=ghcr.io/${{ github.repository }}/build${{ matrix.container_flavor }}-v${{ env.BUILDBOT_VERSION }}
 
       - name: Login to GitHub Container Registry
         uses: docker/login-action@v2
+        if: github.event_name != 'pull_request' || github.repository_owner != 'openwrt'
         with:
           registry: ghcr.io
           username: ${{ github.actor }}
@@ -78,6 +80,7 @@ jobs:
 
       - name: Build container again and push it
         uses: docker/build-push-action@v4
+        if: github.event_name != 'pull_request' || github.repository_owner != 'openwrt'
         with:
           push: true
           tags: ${{ steps.meta.outputs.tags }}