diff --git a/.github/workflows/olbase.yaml b/.github/workflows/olbase.yaml index e6fdc680d6f..905879724df 100644 --- a/.github/workflows/olbase.yaml +++ b/.github/workflows/olbase.yaml @@ -1,6 +1,10 @@ name: olbase on: + # TMP: Way to build PRs for master + pull_request: + branches: + - master schedule: - cron: '00 16 * * 2' workflow_dispatch: @@ -28,10 +32,22 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Build and push + # If on master, use the latest tag, otherwise use the pr number + - name: Master Build and push uses: docker/build-push-action@v6 + if: github.ref == 'refs/heads/master' with: context: "." file: "./docker/Dockerfile.olbase" tags: openlibrary/olbase:latest push: true + + # If in a PR, use the PR number as the tag + - name: Test PR Build and push + uses: docker/build-push-action@v6 + if: github.event_name == 'pull_request' + with: + context: "." + file: "./docker/Dockerfile.olbase" + tags: openlibrary/olbase:pr-${{ github.event.number }} + push: true