Skip to content

Commit 37dc2a6

Browse files
committed
Run Docker CI after PyPI publish or on manual dispatch
No longer triggers on every push/PR. Runs automatically after a successful PyPI publish, or manually via workflow_dispatch.
1 parent 130a4e0 commit 37dc2a6

1 file changed

Lines changed: 8 additions & 18 deletions

File tree

.github/workflows/docker.yml

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,29 @@
11
name: Docker
22

33
on:
4-
push:
5-
branches: [main]
6-
paths:
7-
- 'Dockerfile'
8-
- 'docker-entrypoint.sh'
9-
- '.dockerignore'
10-
- 'sidemantic/**'
11-
- 'pyproject.toml'
12-
pull_request:
13-
paths:
14-
- 'Dockerfile'
15-
- 'docker-entrypoint.sh'
16-
- '.dockerignore'
17-
- 'sidemantic/**'
18-
- 'pyproject.toml'
4+
workflow_dispatch:
5+
workflow_run:
6+
workflows: ["Publish to PyPI"]
7+
types: [completed]
198

209
env:
2110
IMAGE: sidequery/sidemantic
2211

2312
jobs:
2413
docker:
25-
name: Docker build and test
14+
name: Docker build, test, and push
2615
runs-on: ubuntu-latest
16+
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
2717

2818
steps:
2919
- uses: actions/checkout@v4
20+
with:
21+
ref: main
3022

3123
- name: Set up Docker Buildx
3224
uses: docker/setup-buildx-action@v3
3325

3426
- name: Login to Docker Hub
35-
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
3627
uses: docker/login-action@v3
3728
with:
3829
username: ${{ secrets.DOCKERHUB_USERNAME }}
@@ -90,7 +81,6 @@ jobs:
9081
run: docker stop sidemantic-test || true
9182

9283
- name: Push to Docker Hub
93-
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
9484
uses: docker/build-push-action@v6
9585
with:
9686
context: .

0 commit comments

Comments
 (0)