Skip to content

Commit

Permalink
CI: Improve how images workflow works in forks
Browse files Browse the repository at this point in the history
Use the respository owner name rather than hardcoding 'mesonbuild'

Don't run this workflow if docker credentials aren't in secrets
(has to be written rather indirectly due to actions/runner#520)
  • Loading branch information
jon-turney committed May 23, 2021
1 parent d6c76d4 commit 99ad4e9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ on:

jobs:
build:
env:
HAS_DOCKER_CREDENTIALS: ${{ secrets.DOCKER_PASSWORD != '' }}
if: ${{ env.HAS_DOCKER_CREDENTIALS }}
name: ${{ matrix.cfg.name }}
runs-on: ubuntu-latest
strategy:
Expand Down Expand Up @@ -53,4 +56,4 @@ jobs:
# Publish
- name: Push the ${{ matrix.cfg.id }} image
if: github.event_name == 'push' || github.event_name == 'schedule'
run: docker push mesonbuild/${{ matrix.cfg.id }}
run: docker push ${{ github.repository_owner }}/{{ matrix.cfg.id }}

0 comments on commit 99ad4e9

Please sign in to comment.