Skip to content

Commit

Permalink
Update cicd.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
gilmaimon authored Jul 26, 2024
1 parent 7da496a commit 012fd88
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/cicd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ on:
push:
branches:
- '**' # Triggers on push to any branch
- '!master' # Exclude master branch
branches-ignore:
- master # Exclude master branch
pull_request:
branches:
- master # Triggers on PR to master branch
Expand All @@ -24,13 +25,18 @@ jobs:
- name: Build Docker image
run: docker build -t server .

deploy:
needs: build # Ensure deploy job waits for build job
runs-on: ubuntu-latest

steps:
- 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: Push Docker image
if: github.ref == 'refs/heads/master'
run: docker push server:latest

0 comments on commit 012fd88

Please sign in to comment.