Skip to content

Check image updates #372

Check image updates

Check image updates #372

on:
workflow_dispatch:
schedule:
- cron: '0 3 * * *'
name: Check image updates
jobs:
update:
name: Check image updates
runs-on: ubuntu-latest
permissions:
contents: write
outputs:
changes_detected: ${{ steps.check-for-updates.outputs.changes_detected }}
commit_hash: ${{ steps.auto-commit-action.outputs.commit_hash }}
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Check for updates
id: check-for-updates
run: "${GITHUB_WORKSPACE}/.github/updateDockerfile.sh"
- name: Build Docker Image
if: steps.check-for-updates.outputs.changes_detected == 'true'
uses: mr-smithers-excellent/docker-build-push@v6
with:
image: shanemcc/docker-omsa
tags: dev-latest
dockerfile: Dockerfile
registry: docker.io
pushImage: false
- name: Push changed file
id: auto-commit-action
if: steps.check-for-updates.outputs.changes_detected == 'true'
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Update Dockerfile (${{ steps.check-for-updates.outputs.changed_items }})
file_pattern: 'Dockerfile'
build-and-push:
uses: ./.github/workflows/build-and-push.yml
needs: update
secrets: inherit
if: needs.update.outputs.changes_detected == 'true'
with:
commit_hash: ${{ needs.update.outputs.commit_hash }}