Skip to content

Update push-to-docker-hub.yml #243

Update push-to-docker-hub.yml

Update push-to-docker-hub.yml #243

name: Publish Docker #
on:
push:
branches:
- master
schedule:
- cron: '0 2 * * 0' # Weekly on Sundays at 02:00
permissions:
contents: write
jobs:
check:
runs-on: ubuntu-latest
outputs:
image-needs-updating: ${{ steps.check.outputs.needs-updating }}
steps:
- name: Docker Image Update Checker
id: check
uses: lucacome/docker-image-update-checker@v1.2.1
with:
base-image: library/nextcloud:latest
image: gymnae/owncloud:latest
if: ${{ github.event_name == 'schedule' }}
build:
needs: check
if: ${{ github.event_name != 'schedule' || needs.check.outputs.image-needs-updating == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v4
with:
# context: .
platforms: linux/amd64,linux/arm64
push: false
tags: gymnae/owncloud:latest
- name: Slim it
uses: kitabisa/docker-slim-action@v1
env:
DSLIM_HTTP_PROBE: false
with:
target: gymnae/owncloud:latest
tag: "slim"
- run: docker image push "gymnae/owncloud" --all-tags
- uses: gautamkrishnar/keepalive-workflow@v1 # using the workflow with default settings