From 9d9d6dfcf8805541f306b13c3c0c9b16760929c2 Mon Sep 17 00:00:00 2001 From: Drini Cami Date: Mon, 16 Dec 2024 13:04:27 -0500 Subject: [PATCH] TMP: Way to build olbase for testing PRs --- .github/workflows/olbase.yaml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) 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