99 - .github/workflows/dockerimage.yml
1010 - Dockerfile
1111 - pyproject.toml
12+ schedule :
13+ - cron : ' 0 23 * * SUN'
1214
1315concurrency :
1416 group : ${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && github.run_number || github.ref }}
3739 echo "TAG_NAME=${TAG_NAME}" >> $GITHUB_ENV
3840
3941 - name : Login to Docker Hub
40- if : ${{ github.event_name == 'release' }}
42+ if : ${{ github.event_name == 'release' || github.event_name == 'schedule' }}
4143 uses : docker/login-action@v3
4244 with :
4345 username : optunabot
@@ -49,12 +51,31 @@ jobs:
4951 - name : Set up Docker Buildx
5052 uses : docker/setup-buildx-action@v3
5153
52- - name : Build and push
54+ - name : Build and push (Release)
55+ if : ${{ github.event_name == 'release' }}
5356 uses : docker/build-push-action@v6
5457 with :
5558 context : .
5659 platforms : linux/amd64,linux/arm64
57- push : ${{ github.event_name == 'release' }}
60+ push : true
5861 tags : |
5962 ${{ env.DOCKER_HUB_BASE_NAME }}:${{ env.TAG_NAME }}
6063 ${{ env.DOCKER_HUB_BASE_NAME }}:latest
64+
65+ - name : Build and push (Schedule)
66+ if : ${{ github.event_name == 'schedule' }}
67+ uses : docker/build-push-action@v6
68+ with :
69+ context : .
70+ platforms : linux/amd64,linux/arm64
71+ push : true
72+ tags : |
73+ ${{ env.DOCKER_HUB_BASE_NAME }}:latest
74+
75+ - name : Build only (Pull Request)
76+ if : ${{ github.event_name == 'pull_request' }}
77+ uses : docker/build-push-action@v6
78+ with :
79+ context : .
80+ platforms : linux/amd64,linux/arm64
81+ push : false
0 commit comments