edit docker nightly release. Release now scheduled every day + control on last commit (<24h ago)
name: docker nightly release
on:
- workflow_run:
- workflows: ["unit test"]
- types: [completed]
+ schedule:
+ - cron: '0 0 * * *' # everyday at midnight
push:
branches:
- 'master'
@@ -13,16 +12,22 @@ on:
jobs:
docker-nightly-release:
runs-on: ubuntu-latest
- if: ${{ github.event.workflow_run.conclusion == 'success' && github.repository == 'ContinualAI/avalanche' }}
+ # if: ${{ github.repository == 'ContinualAI/avalanche' }}
steps:
- - name: Checkout
+ - name: Checkout repository
uses: actions/checkout@v2
+ - name: Check date of last commit
+ run: |
+ let DIFF=(`date +%s -d "1 day ago"`-`git log -1 --pretty=format:%ct`)
+ echo "date_diff=$DIFF" >> $GITHUB_ENV
- name: Login to DockerHub
+ if: ${{ env.date_diff <= 0 }} # last commit < 24h ago
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PSW }}
- name: Build and push
+ if: ${{ env.date_diff <= 0 }} # last commit < 24h ago
uses: docker/build-push-action@v2
with:
context: docker/nightly
