diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8be078a..fbab29d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,7 +5,7 @@ on: branches: - master tags: - - 'v*' + - "v*" pull_request: branches: - master @@ -54,6 +54,7 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build Spoolman + if: ${{ github.event_name != 'pull_request' }} uses: docker/build-push-action@v4 with: context: . @@ -62,6 +63,16 @@ jobs: cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache-amd64 cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache-amd64,mode=max + # Separate build for pull requests since PRs dont have access to store cache + - name: Build Spoolman (PR) + if: ${{ github.event_name == 'pull_request' }} + uses: docker/build-push-action@v4 + with: + context: . + tags: ${{ env.IMAGE_NAME }}:test + outputs: type=docker,dest=/tmp/spoolman.tar + cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache-amd64 + - name: Upload artifact uses: actions/upload-artifact@v3 with: @@ -87,6 +98,7 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build Spoolman Tester + if: ${{ github.event_name != 'pull_request' }} uses: docker/build-push-action@v4 with: context: ./tests_integration @@ -95,6 +107,16 @@ jobs: cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache-tester cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache-tester,mode=max + # Separate build for pull requests since PRs dont have access to store cache + - name: Build Spoolman Tester (PR) + if: ${{ github.event_name == 'pull_request' }} + uses: docker/build-push-action@v4 + with: + context: ./tests_integration + tags: ${{ env.IMAGE_NAME }}-tester:latest + outputs: type=docker,dest=/tmp/spoolman-tester.tar + cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache-tester + - name: Upload artifact uses: actions/upload-artifact@v3 with: