Skip to content

Commit

Permalink
Update cicd.yaml
Browse files Browse the repository at this point in the history
only login when using master
  • Loading branch information
gilmaimon authored Jul 26, 2024
1 parent abc74aa commit 7da496a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/cicd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,16 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build Docker image
run: docker build -t server .

- name: Log in to Docker Hub
uses: docker/login-action@v2
if: github.ref == 'refs/heads/master'
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build Docker image
run: docker build -t server .

- name: Push Docker image
if: github.ref == 'refs/heads/master'
run: docker push server:latest

0 comments on commit 7da496a

Please sign in to comment.