Skip to content

Commit

Permalink
fix(cicd): do not trigger build for non-main branches
Browse files Browse the repository at this point in the history
  • Loading branch information
panpuchkov committed Dec 24, 2023
1 parent 1f9f16b commit ba80e8d
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Dockerfile lint
if: ${{ env.IMAGE_EXIST == 'false' }}
id: validate-dockerfile
shell: bash
run: |
docker run --rm -e HADOLINT_IGNORE=DL3007,DL3008,DL3018,DL4006,DL3013 -i hadolint/hadolint < Dockerfile
- name: Unit Tests
shell: bash
run: |
Expand All @@ -33,16 +41,10 @@ jobs:
build:
runs-on: ubuntu-latest
needs: unittests
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v3

- name: Dockerfile lint
if: ${{ env.IMAGE_EXIST == 'false' }}
id: validate-dockerfile
shell: bash
run: |
docker run --rm -e HADOLINT_IGNORE=DL3007,DL3008,DL3018,DL4006,DL3013 -i hadolint/hadolint < Dockerfile
- name: Docker Build
shell: bash
run: |
Expand All @@ -57,7 +59,6 @@ jobs:
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Docker Push
if: github.ref == 'refs/heads/main'
shell: bash
run: |
set -x
Expand Down

0 comments on commit ba80e8d

Please sign in to comment.