|
12 | 12 | push:
|
13 | 13 | tags:
|
14 | 14 | - '*.*.*'
|
| 15 | + pull_request: |
| 16 | + paths: ['docker/**'] |
| 17 | + |
15 | 18 | env:
|
16 | 19 | NEEDS_VERSION: 2.0.0
|
| 20 | + DEPLOY_IMAGE: ${{ github.event_name != 'pull_request' }} |
17 | 21 |
|
18 | 22 | jobs:
|
19 | 23 | build:
|
20 | 24 | strategy:
|
| 25 | + fail-fast: ${{ github.event_name != 'pull_request' }} |
21 | 26 | matrix:
|
22 | 27 | base-image: ["sphinxdoc/sphinx:latest", "sphinxdoc/sphinx-latexpdf:latest"]
|
23 | 28 | image: ["sphinxneeds", "sphinxneeds-latexpdf"]
|
@@ -46,30 +51,27 @@ jobs:
|
46 | 51 | latest=true
|
47 | 52 | tags: |
|
48 | 53 | type=pep440,pattern={{version}}
|
49 |
| - - |
50 |
| - # Check if deployment is needed (if no manual trigger was done, defaults to 'y') |
51 |
| - name: Check if deployment is needed |
52 |
| - id: deploycheck |
| 54 | +
|
| 55 | + - name: Check if deployment manually disabled |
| 56 | + if: github.event.inputs.deploy == 'n' |
53 | 57 | run: |
|
54 |
| - DEPLOY_CHECK=${{ github.event.inputs.deploy }} |
55 |
| - echo "::set-output name=value::${DEPLOY_CHECK:-"y"}" |
56 |
| - - |
57 |
| - # Login to Docker Hub Docker Registry for deployment |
58 |
| - name: Login to Docker Hub Docker Registry 🐸 |
| 58 | + echo "DEPLOY_IMAGE=false" >> "$GITHUB_ENV" |
| 59 | +
|
| 60 | + - name: Login to Docker Hub Docker Registry 🐸 |
59 | 61 | uses: docker/login-action@v3
|
60 | 62 | with:
|
61 | 63 | username: ${{ secrets.DOCKERHUB_USERNAME }}
|
62 | 64 | password: ${{ secrets.DOCKERHUB_TOKEN }}
|
63 |
| - - |
64 |
| - name: Build and push html image to Doker Hub Docker Registry 🐳 |
| 65 | + |
| 66 | + - name: Build and push html image to Doker Hub Docker Registry 🐳 |
65 | 67 | id: docker_build
|
66 | 68 | uses: docker/build-push-action@v5
|
67 | 69 | with:
|
68 |
| - push: ${{ github.event_name != 'pull_request' && steps.deploycheck.outputs.value == 'y' }} |
| 70 | + push: ${{ env.DEPLOY_IMAGE == 'true' }} |
69 | 71 | file: docker/Dockerfile
|
70 | 72 | platforms: linux/amd64,linux/arm64
|
71 | 73 | build-args: |
|
72 | 74 | NEEDS_VERSION=${{ env.NEEDS_VERSION }}
|
73 | 75 | BASE_IMAGE=${{ matrix.base-image }}
|
74 | 76 | tags: ${{ steps.meta.outputs.tags }}
|
75 |
| - labels: ${{ steps.meta.outputs.labels }}} |
| 77 | + labels: ${{ steps.meta.outputs.labels }} |
0 commit comments