From f1008c0129eaa21d836ae9e8faa233439f60f912 Mon Sep 17 00:00:00 2001 From: Cory Sanin Date: Tue, 5 Dec 2023 23:27:25 -0500 Subject: [PATCH] Add schedule to keep base up-to-date --- .github/workflows/docker-image.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 662dca4..1a750f0 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -5,6 +5,8 @@ on: branches: [ master ] pull_request: branches: [ master ] + schedule: + - cron: '0 5 * * 3' jobs: @@ -30,18 +32,18 @@ jobs: echo "DOCKER_USERNAME=remote" >> $GITHUB_ENV - name: Build the Docker image - run: docker build . --file Dockerfile --tag "$DOCKER_USERNAME/$REPOSITORY:latest" + run: docker build --pull . --file Dockerfile --tag "$DOCKER_USERNAME/$REPOSITORY:latest" - name: Log in to Docker Hub uses: docker/login-action@v1 - if: github.ref == 'refs/heads/master' && github.event_name == 'push' + if: github.ref == 'refs/heads/master' && (github.event_name == 'push' || github.event_name == 'schedule') with: registry: ${{ env.DH_REGISTRY }} username: ${{ env.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - name: Push to Docker Hub - if: github.ref == 'refs/heads/master' && github.event_name == 'push' + if: github.ref == 'refs/heads/master' && (github.event_name == 'push' || github.event_name == 'schedule') run: docker push "$DOCKER_USERNAME/$REPOSITORY:latest" - name: Log in to the Container registry @@ -59,7 +61,7 @@ jobs: - name: Push to GitHub uses: docker/build-push-action@v2 - if: github.event_name == 'push' + if: github.event_name == 'push' || github.event_name == 'schedule' with: context: . push: true