Skip to content
Merged
Changes from 1 commit
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
27 changes: 24 additions & 3 deletions .github/workflows/dockerimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ on:
- .github/workflows/dockerimage.yml
- Dockerfile
- pyproject.toml
schedule:
- cron: '0 23 * * SUN-THU'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my opinion, running this action every weekday is too frequent, since there are no dependency updates in most cases but the Docker image is still rebuilt. How about reducing the frequency to once a week (e.g. every Monday)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your comment. Sounds reasonable. We'll push the same image again and again according to the recent development velocity of this repository. I'll reduce the frequency to a weekly basis (i.e., 0 23 * * SUN).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The build is now scheduled for Monday at 8:00 AM JST. See ab62c40.


concurrency:
group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && github.run_number || github.ref }}
Expand Down Expand Up @@ -37,7 +39,7 @@ jobs:
echo "TAG_NAME=${TAG_NAME}" >> $GITHUB_ENV

- name: Login to Docker Hub
if: ${{ github.event_name == 'release' }}
if: ${{ github.event_name == 'release' || github.event_name == 'schedule' }}
uses: docker/login-action@v3
with:
username: optunabot
Expand All @@ -49,12 +51,31 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build and push
- name: Build and push (Release)
if: ${{ github.event_name == 'release' }}
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name == 'release' }}
push: true
tags: |
${{ env.DOCKER_HUB_BASE_NAME }}:${{ env.TAG_NAME }}
${{ env.DOCKER_HUB_BASE_NAME }}:latest

- name: Build and push (Schedule)
if: ${{ github.event_name == 'schedule' }}
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: |
${{ env.DOCKER_HUB_BASE_NAME }}:latest

- name: Build only (Pull Request)
if: ${{ github.event_name == 'pull_request' }}
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
push: false