File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -28,10 +28,22 @@ jobs:
2828 username : ${{ secrets.DOCKERHUB_USERNAME }}
2929 password : ${{ secrets.DOCKERHUB_TOKEN }}
3030
31- - name : Build and push
31+ # If on master, use the latest tag, otherwise use the branch name
32+ - name : Master Build and push
3233 uses : docker/build-push-action@v6
34+ if : github.ref == 'refs/heads/master'
3335 with :
3436 context : " ."
3537 file : " ./docker/Dockerfile.olbase"
3638 tags : openlibrary/olbase:latest
3739 push : true
40+
41+ # If on another branch, use the branch name -- just the branch name, not the full ref
42+ - name : Test Branch Build and push
43+ uses : docker/build-push-action@v6
44+ if : github.ref != 'refs/heads/master'
45+ with :
46+ context : " ."
47+ file : " ./docker/Dockerfile.olbase"
48+ tags : openlibrary/olbase:${{ github.ref_name }}
49+ push : true
You can’t perform that action at this time.
0 commit comments