Skip to content

Commit

Permalink
Added validate dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
text-adi committed Apr 4, 2024
1 parent c3b51cf commit 654e535
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,18 @@ jobs:
run: |
echo "prefix_test=test" >> $GITHUB_OUTPUT
lint-dockerfile:
needs: [ vars ]
name: Test dockerfile
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check
run: |
docker run --rm -i -v ./hadolint.yaml:/.config/hadolint.yaml ghcr.io/hadolint/hadolint < Dockerfile
build_and_push:
needs: [ vars ]
needs: [ vars, lint-dockerfile ]
name: Build
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -70,6 +79,11 @@ jobs:
echo "kubectl: '${{ steps.version.outputs.kubectl }}'"
echo "aws: '${{ steps.version.outputs.aws }}'"
- name: Create image tag
id: image_tag
run: |
echo "value=${{ secrets.DOCKER_USERNAME }}/${{ vars.APP_NAME }}:${{ steps.version.outputs.aws }}-${{ steps.version.outputs.kubectl }}" >> "$GITHUB_OUTPUT"
- name: Build and Push Docker Image
uses: docker/build-push-action@v5
with:
Expand All @@ -80,5 +94,5 @@ jobs:
provenance: false
target: local
tags: |
${{ secrets.DOCKER_USERNAME }}/${{ vars.APP_NAME }}:${{ steps.version.outputs.aws }}-${{ steps.version.outputs.kubectl }}
${{ steps.image_tag.outputs.value }}
cache-from: type=gha

0 comments on commit 654e535

Please sign in to comment.