Skip to content

Commit

Permalink
fix: ShowDemo Docker Publishing ( Fixes #105 )
Browse files Browse the repository at this point in the history
Using secrets to publish latest from main
  • Loading branch information
James Brundage committed Apr 14, 2024
1 parent d169617 commit 414db65
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/BuildShowDemo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,15 @@ jobs:
- name: PSA
uses: StartAutomating/PSA@main
id: PSA
- name: Log in to the Container registry
- name: Log in to the Container registry (on main)
if: ${{github.event_name != 'pull_request' && (github.ref_name == 'main' || github.ref_name == 'master' || github.ref_name == 'latest')}}
uses: docker/login-action@master
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GHCR_TOKEN }}
- name: Log in to the Container registry (on branch)
if: ${{github.ref_name != 'main' && github.ref_name != 'master' && github.ref_name == 'latest'}}
uses: docker/login-action@master
with:
registry: ${{ env.REGISTRY }}
Expand Down
15 changes: 13 additions & 2 deletions Build/GitHub/Jobs/BuildShowDemo.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,18 @@
id = 'PSA'
}
@{
'name'='Log in to the Container registry'
'name'='Log in to the Container registry (on main)'
if = '${{github.event_name != ''pull_request'' && (github.ref_name == ''main'' || github.ref_name == ''master'' || github.ref_name == ''latest'')}}'
'uses'='docker/login-action@master'
'with'=@{
'registry'='${{ env.REGISTRY }}'
'username'='${{ github.actor }}'
'password'='${{ secrets.GHCR_TOKEN }}'
}
},
@{
'name'='Log in to the Container registry (on branch)'
if = '${{github.ref_name != ''main'' && github.ref_name != ''master'' && github.ref_name == ''latest''}}'
'uses'='docker/login-action@master'
'with'=@{
'registry'='${{ env.REGISTRY }}'
Expand All @@ -66,7 +77,7 @@
'with'=@{
'images'='${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}'
}
},
},
@{
name = 'Build and push Docker image (from main)'
if = '${{github.event_name != ''pull_request'' && (github.ref_name == ''main'' || github.ref_name == ''master'' || github.ref_name == ''latest'')}}'
Expand Down

0 comments on commit 414db65

Please sign in to comment.