Skip to content

Commit

Permalink
nightly docker build added (#27)
Browse files Browse the repository at this point in the history
* nightly docker build added

* typo fix

* schedule moved to half hour before midnight to prepare test-harness images before most of nightly build fires
  • Loading branch information
maximmi authored Feb 19, 2021
1 parent 40ce0b8 commit 5000add
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@ on:
release:
types:
- created
schedule:
- cron: '30 23 * * *'
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: "Checkout source code at current commit"
uses: actions/checkout@v2
- name: Prepare tags for Docker image
if: (github.event_name == 'release' && github.event.action == 'created') || github.event.pull_request.head.repo.full_name == github.repository
if: (github.event_name == 'release' && github.event.action == 'created') || github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'schedule'
id: prepare
run: |
TAGS=${{ github.repository }}:sha-${GITHUB_SHA:0:7}
Expand All @@ -27,11 +29,14 @@ jobs:
if [[ $VERSION =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
TAGS="$TAGS,${{ github.repository }}:latest"
fi
if [[ ${{ github.event_name }} == 'schedule' ]]; then
TAGS="$TAGS,${{ github.repository }}:latest,${{ github.repository }}:nightly"
fi
echo ::set-output name=tags::${TAGS}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
if: (github.event_name == 'release' && github.event.action == 'created') || github.event.pull_request.head.repo.full_name == github.repository
if: (github.event_name == 'release' && github.event.action == 'created') || github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'schedule'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
Expand All @@ -40,5 +45,5 @@ jobs:
id: docker_build
uses: docker/build-push-action@v2
with:
push: ${{ (github.event_name == 'release' && github.event.action == 'created') || github.event.pull_request.head.repo.full_name == github.repository }}
push: ${{ (github.event_name == 'release' && github.event.action == 'created') || github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'schedule' }}
tags: ${{ steps.prepare.outputs.tags }}

0 comments on commit 5000add

Please sign in to comment.