Skip to content

Commit 2d80a6e

Browse files
authored
fix: add condition to login step
1 parent d58103e commit 2d80a6e

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

.github/workflows/CI.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,18 @@ jobs:
4949
- name: Check formatting
5050
run: make install-deps && make lint
5151

52-
- name: Login container registries
53-
run: |
54-
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
55-
echo '${{ secrets.DOCKER_PASSWORD }}' | docker login -u '${{ secrets.DOCKER_USERNAME }}' --password-stdin
56-
5752
- name: Check buildx bake
5853
run: docker buildx bake --file docker-bake.hcl --print
5954

6055
- name: Build image for tag ${{ matrix.target }}
6156
run: docker buildx bake --file docker-bake.hcl ${{ matrix.target }}
6257

58+
- name: Login container registries
59+
if: github.ref == 'refs/heads/master' && github.event_name == 'workflow_dispatch'
60+
run: |
61+
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
62+
echo '${{ secrets.DOCKER_PASSWORD }}' | docker login -u '${{ secrets.DOCKER_USERNAME }}' --password-stdin
63+
6364
- name: Publish image for tag ${{ matrix.target }}
6465
if: github.ref == 'refs/heads/master' && github.event_name == 'workflow_dispatch'
6566
run: docker buildx bake --file docker-bake.hcl ${{ matrix.target }} --push

0 commit comments

Comments
 (0)