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