From 5fd726c0b1970eb980bb1a30fce701d9522e8a14 Mon Sep 17 00:00:00 2001 From: M Gough <6558104+MGough@users.noreply.github.com> Date: Mon, 27 Apr 2020 18:34:54 +0100 Subject: [PATCH] add schedule to rebuild docker images nightly without cache --- .github/workflows/publish-docker-image.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish-docker-image.yml b/.github/workflows/publish-docker-image.yml index 9035447..0eae2b0 100644 --- a/.github/workflows/publish-docker-image.yml +++ b/.github/workflows/publish-docker-image.yml @@ -8,6 +8,8 @@ on: # Publish `v1.2.3` tags as releases. tags: - v* + schedule: + - cron: "0 01 * * *" env: IMAGE_NAME: demo-microservice @@ -15,14 +17,19 @@ env: jobs: build: runs-on: ubuntu-latest - if: github.event_name == 'push' + if: github.event_name == 'push' || github.event_name == 'schedule' steps: - uses: actions/checkout@v2 - name: Build image + if: github.event_name == 'push' run: docker build . --file Dockerfile --tag image + - name: Build image without cache + if: github.event_name == 'schedule' + run: docker build --pull --no-cache . + - name: Log into registry run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin