Skip to content

Commit

Permalink
fix(workflow): check container files changed
Browse files Browse the repository at this point in the history
  • Loading branch information
njfamirm committed Nov 7, 2023
1 parent 2a34812 commit 2bbb911
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/publish-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,16 @@ jobs:
- name: ⤵️ Checkout repository
uses: actions/[email protected]

- name: Check file changes
id: file_changes
- name: Check Container files changed
id: file_change
uses: dorny/[email protected]
with:
filters: |
dockerfile:
container_folder:
${{ matrix.name }}/*
- name: 🏗 Extract Docker metadata
if: ${{ steps.file_changes.outputs.dockerfile == 'true' }}
if: ${{ steps.file_change.outputs.container_folder == 'true' }}
id: meta
uses: docker/[email protected]
with:
Expand All @@ -63,7 +63,7 @@ jobs:
type=raw,value=${{matrix.version.full}}
- name: 🏗 Install cosign
if: ${{ github.event_name != 'pull_request' }} && ${{ steps.file_changes.outputs.dockerfile == 'true' }}
if: ${{ github.event_name != 'pull_request' && steps.file_change.outputs.container_folder == 'true' }}
uses: sigstore/[email protected]

- name: 🏗 Setup Docker Buildx
Expand All @@ -73,18 +73,18 @@ jobs:
# uses: actions/cache@v3
# with:
# path: /tmp/.buildx-cache
# key: image-${{ matrix.name }}-version-${{ matrix.version.full }}-buildx-${{ hashFiles(format('{0}/Dockerfile', matrix.path)) }}
# key: image-${{ matrix.name }}-version-${{ matrix.version.full }}-buildx-${{ hashFiles(format('{0}/Container_folder', matrix.path)) }}

- name: 🏗 Log into registry ${{env.REGISTRY}}
if: ${{ github.event_name != 'pull_request' }} && ${{ steps.file_changes.outputs.dockerfile == 'true' }}
if: ${{ github.event_name != 'pull_request' && steps.file_change.outputs.container_folder == 'true' }}
uses: docker/[email protected]
with:
registry: ${{env.REGISTRY}}
username: ${{github.repository_owner}}
password: ${{secrets.GITHUB_TOKEN}}

- name: 🚀 Build and push container image
if: ${{ steps.file_changes.outputs.dockerfile == 'true' }}
if: ${{ steps.file_change.outputs.container_folder == 'true' }}
id: build-and-push
uses: docker/[email protected]
with:
Expand All @@ -98,7 +98,7 @@ jobs:
# cache-to: type=local,dest=/tmp/.buildx-cache

- name: 🏗 Sign the published container image
if: ${{github.event_name != 'pull_request'}} && ${{ steps.file_changes.outputs.dockerfile == 'true' }}
if: ${{ github.event_name != 'pull_request' && steps.file_change.outputs.container_folder == 'true' }}
env:
COSIGN_EXPERIMENTAL: 'true'
run: echo "${{steps.meta.outputs.tags}}" | xargs -I {} cosign sign --yes {}@${{steps.build-and-push.outputs.digest}}

0 comments on commit 2bbb911

Please sign in to comment.