@@ -504,6 +504,46 @@ jobs:
504
504
uses : StartAutomating/EZOut@master
505
505
- name : UseHelpOut
506
506
uses : StartAutomating/HelpOut@master
507
+ - name : Log in to ghcr.io
508
+ uses : docker/login-action@master
509
+ with :
510
+ registry : ${{ env.REGISTRY }}
511
+ username : ${{ github.actor }}
512
+ password : ${{ secrets.GITHUB_TOKEN }}
513
+ env :
514
+ REGISTRY : ghcr.io
515
+ - name : Extract Docker Metadata (for branch)
516
+ if : ${{github.ref_name != 'main' && github.ref_name != 'master' && github.ref_name != 'latest'}}
517
+ id : meta
518
+ uses : docker/metadata-action@master
519
+ with :
520
+ images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
521
+ env :
522
+ REGISTRY : ghcr.io
523
+ IMAGE_NAME : ${{ github.repository }}
524
+ - name : Extract Docker Metadata (for main)
525
+ if : ${{github.ref_name == 'main' || github.ref_name == 'master' || github.ref_name == 'latest'}}
526
+ id : metaMain
527
+ uses : docker/metadata-action@master
528
+ with :
529
+ images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
530
+ flavor : latest=true
531
+ - name : Build and push Docker image (from main)
532
+ if : ${{github.ref_name == 'main' || github.ref_name == 'master' || github.ref_name == 'latest'}}
533
+ uses : docker/build-push-action@master
534
+ with :
535
+ context : .
536
+ push : true
537
+ tags : ${{ steps.metaMain.outputs.tags }}
538
+ labels : ${{ steps.metaMain.outputs.labels }}
539
+ - name : Build and push Docker image (from branch)
540
+ if : ${{github.ref_name != 'main' && github.ref_name != 'master' && github.ref_name != 'latest'}}
541
+ uses : docker/build-push-action@master
542
+ with :
543
+ context : .
544
+ push : true
545
+ tags : ${{ steps.meta.outputs.tags }}
546
+ labels : ${{ steps.meta.outputs.labels }}
507
547
env :
508
548
REGISTRY : ghcr.io
509
549
IMAGE_NAME : ${{ github.repository }}
0 commit comments