Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add schedule to rebuild docker images nightly without cache #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/workflows/publish-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,28 @@ on:
# Publish `v1.2.3` tags as releases.
tags:
- v*
schedule:
- cron: "0 01 * * *"

env:
IMAGE_NAME: demo-microservice

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

Expand Down