Skip to content
Merged
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
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'

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