Skip to content

Commit

Permalink
ci: don't login to registry if not needed
Browse files Browse the repository at this point in the history
  • Loading branch information
sbidoul committed Sep 19, 2024
1 parent 29a4796 commit bc202bc
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,6 @@ jobs:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build image
uses: docker/build-push-action@v6
with:
Expand All @@ -139,6 +133,13 @@ jobs:
PYTHONTAG: "${{ matrix.PYTHONTAG }}"
DISTRO: "${{ matrix.DISTRO }}"
run: pytest -v tests
- name: Login to ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
if: ${{ github.repository_owner == 'acsone' && github.ref == 'refs/heads/master' }}
- name: Push image
uses: docker/build-push-action@v6
with:
Expand Down

0 comments on commit bc202bc

Please sign in to comment.